{
  "cells": [
    {
      "cell_type": "markdown",
      "source": [
        "# Columns Selection Pandas "
      ],
      "metadata": {}
    },
    {
      "cell_type": "code",
      "source": [
        "import numpy as np\n",
        "import pandas as pd\n",
        "import matplotlib.pyplot as plt\n",
        "import seaborn as sns\n",
        "sns.set(style=\"white\", color_codes=True)\n",
        "\n",
        "import warnings\n",
        "warnings.filterwarnings(\"ignore\")\n",
        "\n",
        "# fix_yahoo_finance is used to fetch data \n",
        "import fix_yahoo_finance as yf\n",
        "yf.pdr_override()"
      ],
      "outputs": [],
      "execution_count": 1,
      "metadata": {
        "collapsed": false,
        "outputHidden": false,
        "inputHidden": false
      }
    },
    {
      "cell_type": "code",
      "source": [
        "# input\n",
        "symbol = 'AMD'\n",
        "start = '2014-01-01'\n",
        "end = '2019-01-01'\n",
        "\n",
        "# Read data \n",
        "dataset = yf.download(symbol,start,end)\n",
        "\n",
        "# View Columns\n",
        "dataset.head()"
      ],
      "outputs": [
        {
          "output_type": "stream",
          "name": "stdout",
          "text": [
            "[*********************100%***********************]  1 of 1 downloaded\n"
          ]
        },
        {
          "output_type": "execute_result",
          "execution_count": 2,
          "data": {
            "text/html": [
              "<div>\n",
              "<style scoped>\n",
              "    .dataframe tbody tr th:only-of-type {\n",
              "        vertical-align: middle;\n",
              "    }\n",
              "\n",
              "    .dataframe tbody tr th {\n",
              "        vertical-align: top;\n",
              "    }\n",
              "\n",
              "    .dataframe thead th {\n",
              "        text-align: right;\n",
              "    }\n",
              "</style>\n",
              "<table border=\"1\" class=\"dataframe\">\n",
              "  <thead>\n",
              "    <tr style=\"text-align: right;\">\n",
              "      <th></th>\n",
              "      <th>Open</th>\n",
              "      <th>High</th>\n",
              "      <th>Low</th>\n",
              "      <th>Close</th>\n",
              "      <th>Adj Close</th>\n",
              "      <th>Volume</th>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>Date</th>\n",
              "      <th></th>\n",
              "      <th></th>\n",
              "      <th></th>\n",
              "      <th></th>\n",
              "      <th></th>\n",
              "      <th></th>\n",
              "    </tr>\n",
              "  </thead>\n",
              "  <tbody>\n",
              "    <tr>\n",
              "      <th>2014-01-02</th>\n",
              "      <td>3.85</td>\n",
              "      <td>3.98</td>\n",
              "      <td>3.84</td>\n",
              "      <td>3.95</td>\n",
              "      <td>3.95</td>\n",
              "      <td>20548400</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>2014-01-03</th>\n",
              "      <td>3.98</td>\n",
              "      <td>4.00</td>\n",
              "      <td>3.88</td>\n",
              "      <td>4.00</td>\n",
              "      <td>4.00</td>\n",
              "      <td>22887200</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>2014-01-06</th>\n",
              "      <td>4.01</td>\n",
              "      <td>4.18</td>\n",
              "      <td>3.99</td>\n",
              "      <td>4.13</td>\n",
              "      <td>4.13</td>\n",
              "      <td>42398300</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>2014-01-07</th>\n",
              "      <td>4.19</td>\n",
              "      <td>4.25</td>\n",
              "      <td>4.11</td>\n",
              "      <td>4.18</td>\n",
              "      <td>4.18</td>\n",
              "      <td>42932100</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>2014-01-08</th>\n",
              "      <td>4.23</td>\n",
              "      <td>4.26</td>\n",
              "      <td>4.14</td>\n",
              "      <td>4.18</td>\n",
              "      <td>4.18</td>\n",
              "      <td>30678700</td>\n",
              "    </tr>\n",
              "  </tbody>\n",
              "</table>\n",
              "</div>"
            ],
            "text/plain": [
              "            Open  High   Low  Close  Adj Close    Volume\n",
              "Date                                                    \n",
              "2014-01-02  3.85  3.98  3.84   3.95       3.95  20548400\n",
              "2014-01-03  3.98  4.00  3.88   4.00       4.00  22887200\n",
              "2014-01-06  4.01  4.18  3.99   4.13       4.13  42398300\n",
              "2014-01-07  4.19  4.25  4.11   4.18       4.18  42932100\n",
              "2014-01-08  4.23  4.26  4.14   4.18       4.18  30678700"
            ]
          },
          "metadata": {}
        }
      ],
      "execution_count": 2,
      "metadata": {
        "collapsed": false,
        "outputHidden": false,
        "inputHidden": false
      }
    },
    {
      "cell_type": "code",
      "source": [
        "# Create Data\n",
        "dataset['Open_Close'] = (dataset['Open'] - dataset['Adj Close'])/dataset['Open']\n",
        "dataset['High_Low'] = (dataset['High'] - dataset['Low'])/dataset['Low']\n",
        "dataset['Increase_Decrease'] = np.where(dataset['Volume'].shift(-1) > dataset['Volume'],1,0)\n",
        "dataset['Buy_Sell_on_Open'] = np.where(dataset['Open'].shift(-1) > dataset['Open'],1,0)\n",
        "dataset['Buy_Sell'] = np.where(dataset['Adj Close'].shift(-1) > dataset['Adj Close'],1,0)\n",
        "dataset['Returns'] = dataset['Adj Close'].pct_change()\n",
        "dataset = dataset.dropna()"
      ],
      "outputs": [],
      "execution_count": 3,
      "metadata": {
        "collapsed": false,
        "outputHidden": false,
        "inputHidden": false
      }
    },
    {
      "cell_type": "code",
      "source": [
        "dataset.head()"
      ],
      "outputs": [
        {
          "output_type": "execute_result",
          "execution_count": 4,
          "data": {
            "text/html": [
              "<div>\n",
              "<style scoped>\n",
              "    .dataframe tbody tr th:only-of-type {\n",
              "        vertical-align: middle;\n",
              "    }\n",
              "\n",
              "    .dataframe tbody tr th {\n",
              "        vertical-align: top;\n",
              "    }\n",
              "\n",
              "    .dataframe thead th {\n",
              "        text-align: right;\n",
              "    }\n",
              "</style>\n",
              "<table border=\"1\" class=\"dataframe\">\n",
              "  <thead>\n",
              "    <tr style=\"text-align: right;\">\n",
              "      <th></th>\n",
              "      <th>Open</th>\n",
              "      <th>High</th>\n",
              "      <th>Low</th>\n",
              "      <th>Close</th>\n",
              "      <th>Adj Close</th>\n",
              "      <th>Volume</th>\n",
              "      <th>Open_Close</th>\n",
              "      <th>High_Low</th>\n",
              "      <th>Increase_Decrease</th>\n",
              "      <th>Buy_Sell_on_Open</th>\n",
              "      <th>Buy_Sell</th>\n",
              "      <th>Returns</th>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>Date</th>\n",
              "      <th></th>\n",
              "      <th></th>\n",
              "      <th></th>\n",
              "      <th></th>\n",
              "      <th></th>\n",
              "      <th></th>\n",
              "      <th></th>\n",
              "      <th></th>\n",
              "      <th></th>\n",
              "      <th></th>\n",
              "      <th></th>\n",
              "      <th></th>\n",
              "    </tr>\n",
              "  </thead>\n",
              "  <tbody>\n",
              "    <tr>\n",
              "      <th>2014-01-03</th>\n",
              "      <td>3.98</td>\n",
              "      <td>4.00</td>\n",
              "      <td>3.88</td>\n",
              "      <td>4.00</td>\n",
              "      <td>4.00</td>\n",
              "      <td>22887200</td>\n",
              "      <td>-0.005025</td>\n",
              "      <td>0.030928</td>\n",
              "      <td>1</td>\n",
              "      <td>1</td>\n",
              "      <td>1</td>\n",
              "      <td>0.012658</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>2014-01-06</th>\n",
              "      <td>4.01</td>\n",
              "      <td>4.18</td>\n",
              "      <td>3.99</td>\n",
              "      <td>4.13</td>\n",
              "      <td>4.13</td>\n",
              "      <td>42398300</td>\n",
              "      <td>-0.029925</td>\n",
              "      <td>0.047619</td>\n",
              "      <td>1</td>\n",
              "      <td>1</td>\n",
              "      <td>1</td>\n",
              "      <td>0.032500</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>2014-01-07</th>\n",
              "      <td>4.19</td>\n",
              "      <td>4.25</td>\n",
              "      <td>4.11</td>\n",
              "      <td>4.18</td>\n",
              "      <td>4.18</td>\n",
              "      <td>42932100</td>\n",
              "      <td>0.002387</td>\n",
              "      <td>0.034063</td>\n",
              "      <td>0</td>\n",
              "      <td>1</td>\n",
              "      <td>0</td>\n",
              "      <td>0.012107</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>2014-01-08</th>\n",
              "      <td>4.23</td>\n",
              "      <td>4.26</td>\n",
              "      <td>4.14</td>\n",
              "      <td>4.18</td>\n",
              "      <td>4.18</td>\n",
              "      <td>30678700</td>\n",
              "      <td>0.011820</td>\n",
              "      <td>0.028986</td>\n",
              "      <td>0</td>\n",
              "      <td>0</td>\n",
              "      <td>0</td>\n",
              "      <td>0.000000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>2014-01-09</th>\n",
              "      <td>4.20</td>\n",
              "      <td>4.23</td>\n",
              "      <td>4.05</td>\n",
              "      <td>4.09</td>\n",
              "      <td>4.09</td>\n",
              "      <td>30667600</td>\n",
              "      <td>0.026190</td>\n",
              "      <td>0.044444</td>\n",
              "      <td>0</td>\n",
              "      <td>0</td>\n",
              "      <td>1</td>\n",
              "      <td>-0.021531</td>\n",
              "    </tr>\n",
              "  </tbody>\n",
              "</table>\n",
              "</div>"
            ],
            "text/plain": [
              "            Open  High   Low  Close  Adj Close    Volume  Open_Close  \\\n",
              "Date                                                                   \n",
              "2014-01-03  3.98  4.00  3.88   4.00       4.00  22887200   -0.005025   \n",
              "2014-01-06  4.01  4.18  3.99   4.13       4.13  42398300   -0.029925   \n",
              "2014-01-07  4.19  4.25  4.11   4.18       4.18  42932100    0.002387   \n",
              "2014-01-08  4.23  4.26  4.14   4.18       4.18  30678700    0.011820   \n",
              "2014-01-09  4.20  4.23  4.05   4.09       4.09  30667600    0.026190   \n",
              "\n",
              "            High_Low  Increase_Decrease  Buy_Sell_on_Open  Buy_Sell   Returns  \n",
              "Date                                                                           \n",
              "2014-01-03  0.030928                  1                 1         1  0.012658  \n",
              "2014-01-06  0.047619                  1                 1         1  0.032500  \n",
              "2014-01-07  0.034063                  0                 1         0  0.012107  \n",
              "2014-01-08  0.028986                  0                 0         0  0.000000  \n",
              "2014-01-09  0.044444                  0                 0         1 -0.021531  "
            ]
          },
          "metadata": {}
        }
      ],
      "execution_count": 4,
      "metadata": {
        "collapsed": false,
        "outputHidden": false,
        "inputHidden": false
      }
    },
    {
      "cell_type": "markdown",
      "source": [
        "## Feature Selection in dataframe (Pandas)"
      ],
      "metadata": {}
    },
    {
      "cell_type": "code",
      "source": [
        "df = dataset.reset_index()\n",
        "df.head()"
      ],
      "outputs": [
        {
          "output_type": "execute_result",
          "execution_count": 16,
          "data": {
            "text/html": [
              "<div>\n",
              "<style scoped>\n",
              "    .dataframe tbody tr th:only-of-type {\n",
              "        vertical-align: middle;\n",
              "    }\n",
              "\n",
              "    .dataframe tbody tr th {\n",
              "        vertical-align: top;\n",
              "    }\n",
              "\n",
              "    .dataframe thead th {\n",
              "        text-align: right;\n",
              "    }\n",
              "</style>\n",
              "<table border=\"1\" class=\"dataframe\">\n",
              "  <thead>\n",
              "    <tr style=\"text-align: right;\">\n",
              "      <th></th>\n",
              "      <th>Date</th>\n",
              "      <th>Open</th>\n",
              "      <th>High</th>\n",
              "      <th>Low</th>\n",
              "      <th>Close</th>\n",
              "      <th>Adj Close</th>\n",
              "      <th>Volume</th>\n",
              "      <th>Open_Close</th>\n",
              "      <th>High_Low</th>\n",
              "      <th>Increase_Decrease</th>\n",
              "      <th>Buy_Sell_on_Open</th>\n",
              "      <th>Buy_Sell</th>\n",
              "      <th>Returns</th>\n",
              "    </tr>\n",
              "  </thead>\n",
              "  <tbody>\n",
              "    <tr>\n",
              "      <th>0</th>\n",
              "      <td>2014-01-03</td>\n",
              "      <td>3.98</td>\n",
              "      <td>4.00</td>\n",
              "      <td>3.88</td>\n",
              "      <td>4.00</td>\n",
              "      <td>4.00</td>\n",
              "      <td>22887200</td>\n",
              "      <td>-0.005025</td>\n",
              "      <td>0.030928</td>\n",
              "      <td>1</td>\n",
              "      <td>1</td>\n",
              "      <td>1</td>\n",
              "      <td>0.012658</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1</th>\n",
              "      <td>2014-01-06</td>\n",
              "      <td>4.01</td>\n",
              "      <td>4.18</td>\n",
              "      <td>3.99</td>\n",
              "      <td>4.13</td>\n",
              "      <td>4.13</td>\n",
              "      <td>42398300</td>\n",
              "      <td>-0.029925</td>\n",
              "      <td>0.047619</td>\n",
              "      <td>1</td>\n",
              "      <td>1</td>\n",
              "      <td>1</td>\n",
              "      <td>0.032500</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>2</th>\n",
              "      <td>2014-01-07</td>\n",
              "      <td>4.19</td>\n",
              "      <td>4.25</td>\n",
              "      <td>4.11</td>\n",
              "      <td>4.18</td>\n",
              "      <td>4.18</td>\n",
              "      <td>42932100</td>\n",
              "      <td>0.002387</td>\n",
              "      <td>0.034063</td>\n",
              "      <td>0</td>\n",
              "      <td>1</td>\n",
              "      <td>0</td>\n",
              "      <td>0.012107</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>3</th>\n",
              "      <td>2014-01-08</td>\n",
              "      <td>4.23</td>\n",
              "      <td>4.26</td>\n",
              "      <td>4.14</td>\n",
              "      <td>4.18</td>\n",
              "      <td>4.18</td>\n",
              "      <td>30678700</td>\n",
              "      <td>0.011820</td>\n",
              "      <td>0.028986</td>\n",
              "      <td>0</td>\n",
              "      <td>0</td>\n",
              "      <td>0</td>\n",
              "      <td>0.000000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>4</th>\n",
              "      <td>2014-01-09</td>\n",
              "      <td>4.20</td>\n",
              "      <td>4.23</td>\n",
              "      <td>4.05</td>\n",
              "      <td>4.09</td>\n",
              "      <td>4.09</td>\n",
              "      <td>30667600</td>\n",
              "      <td>0.026190</td>\n",
              "      <td>0.044444</td>\n",
              "      <td>0</td>\n",
              "      <td>0</td>\n",
              "      <td>1</td>\n",
              "      <td>-0.021531</td>\n",
              "    </tr>\n",
              "  </tbody>\n",
              "</table>\n",
              "</div>"
            ],
            "text/plain": [
              "        Date  Open  High   Low  Close  Adj Close    Volume  Open_Close  \\\n",
              "0 2014-01-03  3.98  4.00  3.88   4.00       4.00  22887200   -0.005025   \n",
              "1 2014-01-06  4.01  4.18  3.99   4.13       4.13  42398300   -0.029925   \n",
              "2 2014-01-07  4.19  4.25  4.11   4.18       4.18  42932100    0.002387   \n",
              "3 2014-01-08  4.23  4.26  4.14   4.18       4.18  30678700    0.011820   \n",
              "4 2014-01-09  4.20  4.23  4.05   4.09       4.09  30667600    0.026190   \n",
              "\n",
              "   High_Low  Increase_Decrease  Buy_Sell_on_Open  Buy_Sell   Returns  \n",
              "0  0.030928                  1                 1         1  0.012658  \n",
              "1  0.047619                  1                 1         1  0.032500  \n",
              "2  0.034063                  0                 1         0  0.012107  \n",
              "3  0.028986                  0                 0         0  0.000000  \n",
              "4  0.044444                  0                 0         1 -0.021531  "
            ]
          },
          "metadata": {}
        }
      ],
      "execution_count": 16,
      "metadata": {}
    },
    {
      "cell_type": "code",
      "source": [
        "# row 0, all columns\n",
        "df.loc[0, :]"
      ],
      "outputs": [
        {
          "output_type": "execute_result",
          "execution_count": 19,
          "data": {
            "text/plain": [
              "Date                 2014-01-03 00:00:00\n",
              "Open                                3.98\n",
              "High                                   4\n",
              "Low                                 3.88\n",
              "Close                                  4\n",
              "Adj Close                              4\n",
              "Volume                          22887200\n",
              "Open_Close                   -0.00502513\n",
              "High_Low                       0.0309278\n",
              "Increase_Decrease                      1\n",
              "Buy_Sell_on_Open                       1\n",
              "Buy_Sell                               1\n",
              "Returns                        0.0126582\n",
              "Name: 0, dtype: object"
            ]
          },
          "metadata": {}
        }
      ],
      "execution_count": 19,
      "metadata": {
        "collapsed": false,
        "outputHidden": false,
        "inputHidden": false
      }
    },
    {
      "cell_type": "code",
      "source": [
        "# rows 0, 1, 2\n",
        "# all columns\n",
        "df.loc[[0, 1, 2], :]"
      ],
      "outputs": [
        {
          "output_type": "execute_result",
          "execution_count": 21,
          "data": {
            "text/html": [
              "<div>\n",
              "<style scoped>\n",
              "    .dataframe tbody tr th:only-of-type {\n",
              "        vertical-align: middle;\n",
              "    }\n",
              "\n",
              "    .dataframe tbody tr th {\n",
              "        vertical-align: top;\n",
              "    }\n",
              "\n",
              "    .dataframe thead th {\n",
              "        text-align: right;\n",
              "    }\n",
              "</style>\n",
              "<table border=\"1\" class=\"dataframe\">\n",
              "  <thead>\n",
              "    <tr style=\"text-align: right;\">\n",
              "      <th></th>\n",
              "      <th>Date</th>\n",
              "      <th>Open</th>\n",
              "      <th>High</th>\n",
              "      <th>Low</th>\n",
              "      <th>Close</th>\n",
              "      <th>Adj Close</th>\n",
              "      <th>Volume</th>\n",
              "      <th>Open_Close</th>\n",
              "      <th>High_Low</th>\n",
              "      <th>Increase_Decrease</th>\n",
              "      <th>Buy_Sell_on_Open</th>\n",
              "      <th>Buy_Sell</th>\n",
              "      <th>Returns</th>\n",
              "    </tr>\n",
              "  </thead>\n",
              "  <tbody>\n",
              "    <tr>\n",
              "      <th>0</th>\n",
              "      <td>2014-01-03</td>\n",
              "      <td>3.98</td>\n",
              "      <td>4.00</td>\n",
              "      <td>3.88</td>\n",
              "      <td>4.00</td>\n",
              "      <td>4.00</td>\n",
              "      <td>22887200</td>\n",
              "      <td>-0.005025</td>\n",
              "      <td>0.030928</td>\n",
              "      <td>1</td>\n",
              "      <td>1</td>\n",
              "      <td>1</td>\n",
              "      <td>0.012658</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1</th>\n",
              "      <td>2014-01-06</td>\n",
              "      <td>4.01</td>\n",
              "      <td>4.18</td>\n",
              "      <td>3.99</td>\n",
              "      <td>4.13</td>\n",
              "      <td>4.13</td>\n",
              "      <td>42398300</td>\n",
              "      <td>-0.029925</td>\n",
              "      <td>0.047619</td>\n",
              "      <td>1</td>\n",
              "      <td>1</td>\n",
              "      <td>1</td>\n",
              "      <td>0.032500</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>2</th>\n",
              "      <td>2014-01-07</td>\n",
              "      <td>4.19</td>\n",
              "      <td>4.25</td>\n",
              "      <td>4.11</td>\n",
              "      <td>4.18</td>\n",
              "      <td>4.18</td>\n",
              "      <td>42932100</td>\n",
              "      <td>0.002387</td>\n",
              "      <td>0.034063</td>\n",
              "      <td>0</td>\n",
              "      <td>1</td>\n",
              "      <td>0</td>\n",
              "      <td>0.012107</td>\n",
              "    </tr>\n",
              "  </tbody>\n",
              "</table>\n",
              "</div>"
            ],
            "text/plain": [
              "        Date  Open  High   Low  Close  Adj Close    Volume  Open_Close  \\\n",
              "0 2014-01-03  3.98  4.00  3.88   4.00       4.00  22887200   -0.005025   \n",
              "1 2014-01-06  4.01  4.18  3.99   4.13       4.13  42398300   -0.029925   \n",
              "2 2014-01-07  4.19  4.25  4.11   4.18       4.18  42932100    0.002387   \n",
              "\n",
              "   High_Low  Increase_Decrease  Buy_Sell_on_Open  Buy_Sell   Returns  \n",
              "0  0.030928                  1                 1         1  0.012658  \n",
              "1  0.047619                  1                 1         1  0.032500  \n",
              "2  0.034063                  0                 1         0  0.012107  "
            ]
          },
          "metadata": {}
        }
      ],
      "execution_count": 21,
      "metadata": {
        "collapsed": false,
        "outputHidden": false,
        "inputHidden": false
      }
    },
    {
      "cell_type": "code",
      "source": [
        "# more efficient code\n",
        "df.loc[0:2, :]"
      ],
      "outputs": [
        {
          "output_type": "execute_result",
          "execution_count": 22,
          "data": {
            "text/html": [
              "<div>\n",
              "<style scoped>\n",
              "    .dataframe tbody tr th:only-of-type {\n",
              "        vertical-align: middle;\n",
              "    }\n",
              "\n",
              "    .dataframe tbody tr th {\n",
              "        vertical-align: top;\n",
              "    }\n",
              "\n",
              "    .dataframe thead th {\n",
              "        text-align: right;\n",
              "    }\n",
              "</style>\n",
              "<table border=\"1\" class=\"dataframe\">\n",
              "  <thead>\n",
              "    <tr style=\"text-align: right;\">\n",
              "      <th></th>\n",
              "      <th>Date</th>\n",
              "      <th>Open</th>\n",
              "      <th>High</th>\n",
              "      <th>Low</th>\n",
              "      <th>Close</th>\n",
              "      <th>Adj Close</th>\n",
              "      <th>Volume</th>\n",
              "      <th>Open_Close</th>\n",
              "      <th>High_Low</th>\n",
              "      <th>Increase_Decrease</th>\n",
              "      <th>Buy_Sell_on_Open</th>\n",
              "      <th>Buy_Sell</th>\n",
              "      <th>Returns</th>\n",
              "    </tr>\n",
              "  </thead>\n",
              "  <tbody>\n",
              "    <tr>\n",
              "      <th>0</th>\n",
              "      <td>2014-01-03</td>\n",
              "      <td>3.98</td>\n",
              "      <td>4.00</td>\n",
              "      <td>3.88</td>\n",
              "      <td>4.00</td>\n",
              "      <td>4.00</td>\n",
              "      <td>22887200</td>\n",
              "      <td>-0.005025</td>\n",
              "      <td>0.030928</td>\n",
              "      <td>1</td>\n",
              "      <td>1</td>\n",
              "      <td>1</td>\n",
              "      <td>0.012658</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1</th>\n",
              "      <td>2014-01-06</td>\n",
              "      <td>4.01</td>\n",
              "      <td>4.18</td>\n",
              "      <td>3.99</td>\n",
              "      <td>4.13</td>\n",
              "      <td>4.13</td>\n",
              "      <td>42398300</td>\n",
              "      <td>-0.029925</td>\n",
              "      <td>0.047619</td>\n",
              "      <td>1</td>\n",
              "      <td>1</td>\n",
              "      <td>1</td>\n",
              "      <td>0.032500</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>2</th>\n",
              "      <td>2014-01-07</td>\n",
              "      <td>4.19</td>\n",
              "      <td>4.25</td>\n",
              "      <td>4.11</td>\n",
              "      <td>4.18</td>\n",
              "      <td>4.18</td>\n",
              "      <td>42932100</td>\n",
              "      <td>0.002387</td>\n",
              "      <td>0.034063</td>\n",
              "      <td>0</td>\n",
              "      <td>1</td>\n",
              "      <td>0</td>\n",
              "      <td>0.012107</td>\n",
              "    </tr>\n",
              "  </tbody>\n",
              "</table>\n",
              "</div>"
            ],
            "text/plain": [
              "        Date  Open  High   Low  Close  Adj Close    Volume  Open_Close  \\\n",
              "0 2014-01-03  3.98  4.00  3.88   4.00       4.00  22887200   -0.005025   \n",
              "1 2014-01-06  4.01  4.18  3.99   4.13       4.13  42398300   -0.029925   \n",
              "2 2014-01-07  4.19  4.25  4.11   4.18       4.18  42932100    0.002387   \n",
              "\n",
              "   High_Low  Increase_Decrease  Buy_Sell_on_Open  Buy_Sell   Returns  \n",
              "0  0.030928                  1                 1         1  0.012658  \n",
              "1  0.047619                  1                 1         1  0.032500  \n",
              "2  0.034063                  0                 1         0  0.012107  "
            ]
          },
          "metadata": {}
        }
      ],
      "execution_count": 22,
      "metadata": {
        "collapsed": false,
        "outputHidden": false,
        "inputHidden": false
      }
    },
    {
      "cell_type": "code",
      "source": [
        "df.loc[0:2]"
      ],
      "outputs": [
        {
          "output_type": "execute_result",
          "execution_count": 23,
          "data": {
            "text/html": [
              "<div>\n",
              "<style scoped>\n",
              "    .dataframe tbody tr th:only-of-type {\n",
              "        vertical-align: middle;\n",
              "    }\n",
              "\n",
              "    .dataframe tbody tr th {\n",
              "        vertical-align: top;\n",
              "    }\n",
              "\n",
              "    .dataframe thead th {\n",
              "        text-align: right;\n",
              "    }\n",
              "</style>\n",
              "<table border=\"1\" class=\"dataframe\">\n",
              "  <thead>\n",
              "    <tr style=\"text-align: right;\">\n",
              "      <th></th>\n",
              "      <th>Date</th>\n",
              "      <th>Open</th>\n",
              "      <th>High</th>\n",
              "      <th>Low</th>\n",
              "      <th>Close</th>\n",
              "      <th>Adj Close</th>\n",
              "      <th>Volume</th>\n",
              "      <th>Open_Close</th>\n",
              "      <th>High_Low</th>\n",
              "      <th>Increase_Decrease</th>\n",
              "      <th>Buy_Sell_on_Open</th>\n",
              "      <th>Buy_Sell</th>\n",
              "      <th>Returns</th>\n",
              "    </tr>\n",
              "  </thead>\n",
              "  <tbody>\n",
              "    <tr>\n",
              "      <th>0</th>\n",
              "      <td>2014-01-03</td>\n",
              "      <td>3.98</td>\n",
              "      <td>4.00</td>\n",
              "      <td>3.88</td>\n",
              "      <td>4.00</td>\n",
              "      <td>4.00</td>\n",
              "      <td>22887200</td>\n",
              "      <td>-0.005025</td>\n",
              "      <td>0.030928</td>\n",
              "      <td>1</td>\n",
              "      <td>1</td>\n",
              "      <td>1</td>\n",
              "      <td>0.012658</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1</th>\n",
              "      <td>2014-01-06</td>\n",
              "      <td>4.01</td>\n",
              "      <td>4.18</td>\n",
              "      <td>3.99</td>\n",
              "      <td>4.13</td>\n",
              "      <td>4.13</td>\n",
              "      <td>42398300</td>\n",
              "      <td>-0.029925</td>\n",
              "      <td>0.047619</td>\n",
              "      <td>1</td>\n",
              "      <td>1</td>\n",
              "      <td>1</td>\n",
              "      <td>0.032500</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>2</th>\n",
              "      <td>2014-01-07</td>\n",
              "      <td>4.19</td>\n",
              "      <td>4.25</td>\n",
              "      <td>4.11</td>\n",
              "      <td>4.18</td>\n",
              "      <td>4.18</td>\n",
              "      <td>42932100</td>\n",
              "      <td>0.002387</td>\n",
              "      <td>0.034063</td>\n",
              "      <td>0</td>\n",
              "      <td>1</td>\n",
              "      <td>0</td>\n",
              "      <td>0.012107</td>\n",
              "    </tr>\n",
              "  </tbody>\n",
              "</table>\n",
              "</div>"
            ],
            "text/plain": [
              "        Date  Open  High   Low  Close  Adj Close    Volume  Open_Close  \\\n",
              "0 2014-01-03  3.98  4.00  3.88   4.00       4.00  22887200   -0.005025   \n",
              "1 2014-01-06  4.01  4.18  3.99   4.13       4.13  42398300   -0.029925   \n",
              "2 2014-01-07  4.19  4.25  4.11   4.18       4.18  42932100    0.002387   \n",
              "\n",
              "   High_Low  Increase_Decrease  Buy_Sell_on_Open  Buy_Sell   Returns  \n",
              "0  0.030928                  1                 1         1  0.012658  \n",
              "1  0.047619                  1                 1         1  0.032500  \n",
              "2  0.034063                  0                 1         0  0.012107  "
            ]
          },
          "metadata": {}
        }
      ],
      "execution_count": 23,
      "metadata": {
        "collapsed": false,
        "outputHidden": false,
        "inputHidden": false
      }
    },
    {
      "cell_type": "code",
      "source": [
        "# all rows\n",
        "# column: Open\n",
        "df.loc[:, 'Open']"
      ],
      "outputs": [
        {
          "output_type": "execute_result",
          "execution_count": 24,
          "data": {
            "text/plain": [
              "0        3.980000\n",
              "1        4.010000\n",
              "2        4.190000\n",
              "3        4.230000\n",
              "4        4.200000\n",
              "5        4.090000\n",
              "6        4.190000\n",
              "7        4.140000\n",
              "8        4.340000\n",
              "9        4.500000\n",
              "10       4.150000\n",
              "11       4.310000\n",
              "12       3.790000\n",
              "13       3.670000\n",
              "14       3.600000\n",
              "15       3.480000\n",
              "16       3.430000\n",
              "17       3.520000\n",
              "18       3.510000\n",
              "19       3.450000\n",
              "20       3.430000\n",
              "21       3.350000\n",
              "22       3.360000\n",
              "23       3.320000\n",
              "24       3.460000\n",
              "25       3.500000\n",
              "26       3.660000\n",
              "27       3.710000\n",
              "28       3.640000\n",
              "29       3.700000\n",
              "          ...    \n",
              "1227    20.719999\n",
              "1228    19.870001\n",
              "1229    20.400000\n",
              "1230    17.400000\n",
              "1231    20.049999\n",
              "1232    18.610001\n",
              "1233    19.959999\n",
              "1234    19.770000\n",
              "1235    21.820000\n",
              "1236    21.190001\n",
              "1237    21.299999\n",
              "1238    22.480000\n",
              "1239    23.350000\n",
              "1240    20.219999\n",
              "1241    21.299999\n",
              "1242    19.350000\n",
              "1243    20.709999\n",
              "1244    20.320000\n",
              "1245    20.629999\n",
              "1246    19.580000\n",
              "1247    20.010000\n",
              "1248    19.150000\n",
              "1249    19.440001\n",
              "1250    18.110001\n",
              "1251    18.120001\n",
              "1252    16.520000\n",
              "1253    16.879999\n",
              "1254    17.430000\n",
              "1255    17.530001\n",
              "1256    18.150000\n",
              "Name: Open, Length: 1257, dtype: float64"
            ]
          },
          "metadata": {}
        }
      ],
      "execution_count": 24,
      "metadata": {
        "collapsed": false,
        "outputHidden": false,
        "inputHidden": false
      }
    },
    {
      "cell_type": "code",
      "source": [
        "# all rows\n",
        "# column: Low, High\n",
        "df.loc[:, ['High', 'Low']]"
      ],
      "outputs": [
        {
          "output_type": "execute_result",
          "execution_count": 28,
          "data": {
            "text/html": [
              "<div>\n",
              "<style scoped>\n",
              "    .dataframe tbody tr th:only-of-type {\n",
              "        vertical-align: middle;\n",
              "    }\n",
              "\n",
              "    .dataframe tbody tr th {\n",
              "        vertical-align: top;\n",
              "    }\n",
              "\n",
              "    .dataframe thead th {\n",
              "        text-align: right;\n",
              "    }\n",
              "</style>\n",
              "<table border=\"1\" class=\"dataframe\">\n",
              "  <thead>\n",
              "    <tr style=\"text-align: right;\">\n",
              "      <th></th>\n",
              "      <th>High</th>\n",
              "      <th>Low</th>\n",
              "    </tr>\n",
              "  </thead>\n",
              "  <tbody>\n",
              "    <tr>\n",
              "      <th>0</th>\n",
              "      <td>4.000000</td>\n",
              "      <td>3.880000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1</th>\n",
              "      <td>4.180000</td>\n",
              "      <td>3.990000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>2</th>\n",
              "      <td>4.250000</td>\n",
              "      <td>4.110000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>3</th>\n",
              "      <td>4.260000</td>\n",
              "      <td>4.140000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>4</th>\n",
              "      <td>4.230000</td>\n",
              "      <td>4.050000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>5</th>\n",
              "      <td>4.200000</td>\n",
              "      <td>4.070000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>6</th>\n",
              "      <td>4.200000</td>\n",
              "      <td>4.090000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>7</th>\n",
              "      <td>4.300000</td>\n",
              "      <td>4.130000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>8</th>\n",
              "      <td>4.600000</td>\n",
              "      <td>4.320000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>9</th>\n",
              "      <td>4.510000</td>\n",
              "      <td>4.320000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>10</th>\n",
              "      <td>4.350000</td>\n",
              "      <td>4.110000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>11</th>\n",
              "      <td>4.340000</td>\n",
              "      <td>4.130000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>12</th>\n",
              "      <td>3.820000</td>\n",
              "      <td>3.660000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>13</th>\n",
              "      <td>3.680000</td>\n",
              "      <td>3.580000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>14</th>\n",
              "      <td>3.610000</td>\n",
              "      <td>3.410000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>15</th>\n",
              "      <td>3.490000</td>\n",
              "      <td>3.350000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>16</th>\n",
              "      <td>3.570000</td>\n",
              "      <td>3.410000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>17</th>\n",
              "      <td>3.560000</td>\n",
              "      <td>3.450000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>18</th>\n",
              "      <td>3.520000</td>\n",
              "      <td>3.450000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>19</th>\n",
              "      <td>3.470000</td>\n",
              "      <td>3.430000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>20</th>\n",
              "      <td>3.440000</td>\n",
              "      <td>3.330000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>21</th>\n",
              "      <td>3.430000</td>\n",
              "      <td>3.300000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>22</th>\n",
              "      <td>3.370000</td>\n",
              "      <td>3.290000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>23</th>\n",
              "      <td>3.460000</td>\n",
              "      <td>3.320000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>24</th>\n",
              "      <td>3.500000</td>\n",
              "      <td>3.420000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>25</th>\n",
              "      <td>3.640000</td>\n",
              "      <td>3.450000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>26</th>\n",
              "      <td>3.750000</td>\n",
              "      <td>3.650000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>27</th>\n",
              "      <td>3.730000</td>\n",
              "      <td>3.630000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>28</th>\n",
              "      <td>3.710000</td>\n",
              "      <td>3.640000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>29</th>\n",
              "      <td>3.720000</td>\n",
              "      <td>3.640000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>...</th>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1227</th>\n",
              "      <td>21.770000</td>\n",
              "      <td>20.420000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1228</th>\n",
              "      <td>20.969999</td>\n",
              "      <td>19.719999</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1229</th>\n",
              "      <td>20.590000</td>\n",
              "      <td>19.090000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1230</th>\n",
              "      <td>19.580000</td>\n",
              "      <td>17.180000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1231</th>\n",
              "      <td>20.309999</td>\n",
              "      <td>18.500000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1232</th>\n",
              "      <td>19.830000</td>\n",
              "      <td>18.559999</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1233</th>\n",
              "      <td>20.190001</td>\n",
              "      <td>19.110001</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1234</th>\n",
              "      <td>21.450001</td>\n",
              "      <td>19.730000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1235</th>\n",
              "      <td>21.879999</td>\n",
              "      <td>20.180000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1236</th>\n",
              "      <td>21.610001</td>\n",
              "      <td>20.730000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1237</th>\n",
              "      <td>21.360001</td>\n",
              "      <td>20.520000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1238</th>\n",
              "      <td>23.750000</td>\n",
              "      <td>22.370001</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1239</th>\n",
              "      <td>23.420000</td>\n",
              "      <td>21.070000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1240</th>\n",
              "      <td>21.410000</td>\n",
              "      <td>20.059999</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1241</th>\n",
              "      <td>21.379999</td>\n",
              "      <td>19.170000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1242</th>\n",
              "      <td>20.129999</td>\n",
              "      <td>19.270000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1243</th>\n",
              "      <td>21.139999</td>\n",
              "      <td>19.690001</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1244</th>\n",
              "      <td>21.020000</td>\n",
              "      <td>19.709999</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1245</th>\n",
              "      <td>20.870001</td>\n",
              "      <td>19.760000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1246</th>\n",
              "      <td>20.700001</td>\n",
              "      <td>19.520000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1247</th>\n",
              "      <td>20.020000</td>\n",
              "      <td>18.639999</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1248</th>\n",
              "      <td>19.840000</td>\n",
              "      <td>18.879999</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1249</th>\n",
              "      <td>19.719999</td>\n",
              "      <td>18.000000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1250</th>\n",
              "      <td>18.860001</td>\n",
              "      <td>17.340000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1251</th>\n",
              "      <td>18.340000</td>\n",
              "      <td>16.760000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1252</th>\n",
              "      <td>17.219999</td>\n",
              "      <td>16.370001</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1253</th>\n",
              "      <td>17.910000</td>\n",
              "      <td>16.030001</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1254</th>\n",
              "      <td>17.740000</td>\n",
              "      <td>16.440001</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1255</th>\n",
              "      <td>18.309999</td>\n",
              "      <td>17.139999</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1256</th>\n",
              "      <td>18.510000</td>\n",
              "      <td>17.850000</td>\n",
              "    </tr>\n",
              "  </tbody>\n",
              "</table>\n",
              "<p>1257 rows × 2 columns</p>\n",
              "</div>"
            ],
            "text/plain": [
              "           High        Low\n",
              "0      4.000000   3.880000\n",
              "1      4.180000   3.990000\n",
              "2      4.250000   4.110000\n",
              "3      4.260000   4.140000\n",
              "4      4.230000   4.050000\n",
              "5      4.200000   4.070000\n",
              "6      4.200000   4.090000\n",
              "7      4.300000   4.130000\n",
              "8      4.600000   4.320000\n",
              "9      4.510000   4.320000\n",
              "10     4.350000   4.110000\n",
              "11     4.340000   4.130000\n",
              "12     3.820000   3.660000\n",
              "13     3.680000   3.580000\n",
              "14     3.610000   3.410000\n",
              "15     3.490000   3.350000\n",
              "16     3.570000   3.410000\n",
              "17     3.560000   3.450000\n",
              "18     3.520000   3.450000\n",
              "19     3.470000   3.430000\n",
              "20     3.440000   3.330000\n",
              "21     3.430000   3.300000\n",
              "22     3.370000   3.290000\n",
              "23     3.460000   3.320000\n",
              "24     3.500000   3.420000\n",
              "25     3.640000   3.450000\n",
              "26     3.750000   3.650000\n",
              "27     3.730000   3.630000\n",
              "28     3.710000   3.640000\n",
              "29     3.720000   3.640000\n",
              "...         ...        ...\n",
              "1227  21.770000  20.420000\n",
              "1228  20.969999  19.719999\n",
              "1229  20.590000  19.090000\n",
              "1230  19.580000  17.180000\n",
              "1231  20.309999  18.500000\n",
              "1232  19.830000  18.559999\n",
              "1233  20.190001  19.110001\n",
              "1234  21.450001  19.730000\n",
              "1235  21.879999  20.180000\n",
              "1236  21.610001  20.730000\n",
              "1237  21.360001  20.520000\n",
              "1238  23.750000  22.370001\n",
              "1239  23.420000  21.070000\n",
              "1240  21.410000  20.059999\n",
              "1241  21.379999  19.170000\n",
              "1242  20.129999  19.270000\n",
              "1243  21.139999  19.690001\n",
              "1244  21.020000  19.709999\n",
              "1245  20.870001  19.760000\n",
              "1246  20.700001  19.520000\n",
              "1247  20.020000  18.639999\n",
              "1248  19.840000  18.879999\n",
              "1249  19.719999  18.000000\n",
              "1250  18.860001  17.340000\n",
              "1251  18.340000  16.760000\n",
              "1252  17.219999  16.370001\n",
              "1253  17.910000  16.030001\n",
              "1254  17.740000  16.440001\n",
              "1255  18.309999  17.139999\n",
              "1256  18.510000  17.850000\n",
              "\n[1257 rows x 2 columns]"
            ]
          },
          "metadata": {}
        }
      ],
      "execution_count": 28,
      "metadata": {
        "collapsed": false,
        "outputHidden": false,
        "inputHidden": false
      }
    },
    {
      "cell_type": "code",
      "source": [
        "df.loc[:, 'High':'Volume'] "
      ],
      "outputs": [
        {
          "output_type": "execute_result",
          "execution_count": 29,
          "data": {
            "text/html": [
              "<div>\n",
              "<style scoped>\n",
              "    .dataframe tbody tr th:only-of-type {\n",
              "        vertical-align: middle;\n",
              "    }\n",
              "\n",
              "    .dataframe tbody tr th {\n",
              "        vertical-align: top;\n",
              "    }\n",
              "\n",
              "    .dataframe thead th {\n",
              "        text-align: right;\n",
              "    }\n",
              "</style>\n",
              "<table border=\"1\" class=\"dataframe\">\n",
              "  <thead>\n",
              "    <tr style=\"text-align: right;\">\n",
              "      <th></th>\n",
              "      <th>High</th>\n",
              "      <th>Low</th>\n",
              "      <th>Close</th>\n",
              "      <th>Adj Close</th>\n",
              "      <th>Volume</th>\n",
              "    </tr>\n",
              "  </thead>\n",
              "  <tbody>\n",
              "    <tr>\n",
              "      <th>0</th>\n",
              "      <td>4.000000</td>\n",
              "      <td>3.880000</td>\n",
              "      <td>4.000000</td>\n",
              "      <td>4.000000</td>\n",
              "      <td>22887200</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1</th>\n",
              "      <td>4.180000</td>\n",
              "      <td>3.990000</td>\n",
              "      <td>4.130000</td>\n",
              "      <td>4.130000</td>\n",
              "      <td>42398300</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>2</th>\n",
              "      <td>4.250000</td>\n",
              "      <td>4.110000</td>\n",
              "      <td>4.180000</td>\n",
              "      <td>4.180000</td>\n",
              "      <td>42932100</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>3</th>\n",
              "      <td>4.260000</td>\n",
              "      <td>4.140000</td>\n",
              "      <td>4.180000</td>\n",
              "      <td>4.180000</td>\n",
              "      <td>30678700</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>4</th>\n",
              "      <td>4.230000</td>\n",
              "      <td>4.050000</td>\n",
              "      <td>4.090000</td>\n",
              "      <td>4.090000</td>\n",
              "      <td>30667600</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>5</th>\n",
              "      <td>4.200000</td>\n",
              "      <td>4.070000</td>\n",
              "      <td>4.170000</td>\n",
              "      <td>4.170000</td>\n",
              "      <td>20840800</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>6</th>\n",
              "      <td>4.200000</td>\n",
              "      <td>4.090000</td>\n",
              "      <td>4.130000</td>\n",
              "      <td>4.130000</td>\n",
              "      <td>22856100</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>7</th>\n",
              "      <td>4.300000</td>\n",
              "      <td>4.130000</td>\n",
              "      <td>4.300000</td>\n",
              "      <td>4.300000</td>\n",
              "      <td>42434800</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>8</th>\n",
              "      <td>4.600000</td>\n",
              "      <td>4.320000</td>\n",
              "      <td>4.470000</td>\n",
              "      <td>4.470000</td>\n",
              "      <td>66613100</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>9</th>\n",
              "      <td>4.510000</td>\n",
              "      <td>4.320000</td>\n",
              "      <td>4.380000</td>\n",
              "      <td>4.380000</td>\n",
              "      <td>46975600</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>10</th>\n",
              "      <td>4.350000</td>\n",
              "      <td>4.110000</td>\n",
              "      <td>4.180000</td>\n",
              "      <td>4.180000</td>\n",
              "      <td>45842700</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>11</th>\n",
              "      <td>4.340000</td>\n",
              "      <td>4.130000</td>\n",
              "      <td>4.170000</td>\n",
              "      <td>4.170000</td>\n",
              "      <td>58702900</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>12</th>\n",
              "      <td>3.820000</td>\n",
              "      <td>3.660000</td>\n",
              "      <td>3.670000</td>\n",
              "      <td>3.670000</td>\n",
              "      <td>86329500</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>13</th>\n",
              "      <td>3.680000</td>\n",
              "      <td>3.580000</td>\n",
              "      <td>3.620000</td>\n",
              "      <td>3.620000</td>\n",
              "      <td>29844700</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>14</th>\n",
              "      <td>3.610000</td>\n",
              "      <td>3.410000</td>\n",
              "      <td>3.470000</td>\n",
              "      <td>3.470000</td>\n",
              "      <td>48095800</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>15</th>\n",
              "      <td>3.490000</td>\n",
              "      <td>3.350000</td>\n",
              "      <td>3.410000</td>\n",
              "      <td>3.410000</td>\n",
              "      <td>31332300</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>16</th>\n",
              "      <td>3.570000</td>\n",
              "      <td>3.410000</td>\n",
              "      <td>3.540000</td>\n",
              "      <td>3.540000</td>\n",
              "      <td>27962600</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>17</th>\n",
              "      <td>3.560000</td>\n",
              "      <td>3.450000</td>\n",
              "      <td>3.480000</td>\n",
              "      <td>3.480000</td>\n",
              "      <td>21765000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>18</th>\n",
              "      <td>3.520000</td>\n",
              "      <td>3.450000</td>\n",
              "      <td>3.480000</td>\n",
              "      <td>3.480000</td>\n",
              "      <td>17111700</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>19</th>\n",
              "      <td>3.470000</td>\n",
              "      <td>3.430000</td>\n",
              "      <td>3.430000</td>\n",
              "      <td>3.430000</td>\n",
              "      <td>13602100</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>20</th>\n",
              "      <td>3.440000</td>\n",
              "      <td>3.330000</td>\n",
              "      <td>3.330000</td>\n",
              "      <td>3.330000</td>\n",
              "      <td>22280200</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>21</th>\n",
              "      <td>3.430000</td>\n",
              "      <td>3.300000</td>\n",
              "      <td>3.370000</td>\n",
              "      <td>3.370000</td>\n",
              "      <td>22681000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>22</th>\n",
              "      <td>3.370000</td>\n",
              "      <td>3.290000</td>\n",
              "      <td>3.310000</td>\n",
              "      <td>3.310000</td>\n",
              "      <td>14858900</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>23</th>\n",
              "      <td>3.460000</td>\n",
              "      <td>3.320000</td>\n",
              "      <td>3.410000</td>\n",
              "      <td>3.410000</td>\n",
              "      <td>16072900</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>24</th>\n",
              "      <td>3.500000</td>\n",
              "      <td>3.420000</td>\n",
              "      <td>3.470000</td>\n",
              "      <td>3.470000</td>\n",
              "      <td>23119700</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>25</th>\n",
              "      <td>3.640000</td>\n",
              "      <td>3.450000</td>\n",
              "      <td>3.630000</td>\n",
              "      <td>3.630000</td>\n",
              "      <td>21241100</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>26</th>\n",
              "      <td>3.750000</td>\n",
              "      <td>3.650000</td>\n",
              "      <td>3.700000</td>\n",
              "      <td>3.700000</td>\n",
              "      <td>34198100</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>27</th>\n",
              "      <td>3.730000</td>\n",
              "      <td>3.630000</td>\n",
              "      <td>3.690000</td>\n",
              "      <td>3.690000</td>\n",
              "      <td>18321300</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>28</th>\n",
              "      <td>3.710000</td>\n",
              "      <td>3.640000</td>\n",
              "      <td>3.700000</td>\n",
              "      <td>3.700000</td>\n",
              "      <td>13368600</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>29</th>\n",
              "      <td>3.720000</td>\n",
              "      <td>3.640000</td>\n",
              "      <td>3.690000</td>\n",
              "      <td>3.690000</td>\n",
              "      <td>12387900</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>...</th>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1227</th>\n",
              "      <td>21.770000</td>\n",
              "      <td>20.420000</td>\n",
              "      <td>21.490000</td>\n",
              "      <td>21.490000</td>\n",
              "      <td>97715500</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1228</th>\n",
              "      <td>20.969999</td>\n",
              "      <td>19.719999</td>\n",
              "      <td>20.660000</td>\n",
              "      <td>20.660000</td>\n",
              "      <td>112376600</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1229</th>\n",
              "      <td>20.590000</td>\n",
              "      <td>19.090000</td>\n",
              "      <td>19.110001</td>\n",
              "      <td>19.110001</td>\n",
              "      <td>93578200</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1230</th>\n",
              "      <td>19.580000</td>\n",
              "      <td>17.180000</td>\n",
              "      <td>19.209999</td>\n",
              "      <td>19.209999</td>\n",
              "      <td>109869400</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1231</th>\n",
              "      <td>20.309999</td>\n",
              "      <td>18.500000</td>\n",
              "      <td>18.730000</td>\n",
              "      <td>18.730000</td>\n",
              "      <td>81585600</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1232</th>\n",
              "      <td>19.830000</td>\n",
              "      <td>18.559999</td>\n",
              "      <td>19.379999</td>\n",
              "      <td>19.379999</td>\n",
              "      <td>54611300</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1233</th>\n",
              "      <td>20.190001</td>\n",
              "      <td>19.110001</td>\n",
              "      <td>20.080000</td>\n",
              "      <td>20.080000</td>\n",
              "      <td>83211000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1234</th>\n",
              "      <td>21.450001</td>\n",
              "      <td>19.730000</td>\n",
              "      <td>21.049999</td>\n",
              "      <td>21.049999</td>\n",
              "      <td>119230100</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1235</th>\n",
              "      <td>21.879999</td>\n",
              "      <td>20.180000</td>\n",
              "      <td>21.340000</td>\n",
              "      <td>21.340000</td>\n",
              "      <td>134425300</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1236</th>\n",
              "      <td>21.610001</td>\n",
              "      <td>20.730000</td>\n",
              "      <td>21.430000</td>\n",
              "      <td>21.430000</td>\n",
              "      <td>79853700</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1237</th>\n",
              "      <td>21.360001</td>\n",
              "      <td>20.520000</td>\n",
              "      <td>21.299999</td>\n",
              "      <td>21.299999</td>\n",
              "      <td>82370700</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1238</th>\n",
              "      <td>23.750000</td>\n",
              "      <td>22.370001</td>\n",
              "      <td>23.709999</td>\n",
              "      <td>23.709999</td>\n",
              "      <td>139607400</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1239</th>\n",
              "      <td>23.420000</td>\n",
              "      <td>21.070000</td>\n",
              "      <td>21.120001</td>\n",
              "      <td>21.120001</td>\n",
              "      <td>127392900</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1240</th>\n",
              "      <td>21.410000</td>\n",
              "      <td>20.059999</td>\n",
              "      <td>21.299999</td>\n",
              "      <td>21.299999</td>\n",
              "      <td>103434700</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1241</th>\n",
              "      <td>21.379999</td>\n",
              "      <td>19.170000</td>\n",
              "      <td>19.459999</td>\n",
              "      <td>19.459999</td>\n",
              "      <td>105764500</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1242</th>\n",
              "      <td>20.129999</td>\n",
              "      <td>19.270000</td>\n",
              "      <td>19.990000</td>\n",
              "      <td>19.990000</td>\n",
              "      <td>77984500</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1243</th>\n",
              "      <td>21.139999</td>\n",
              "      <td>19.690001</td>\n",
              "      <td>19.980000</td>\n",
              "      <td>19.980000</td>\n",
              "      <td>88027400</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1244</th>\n",
              "      <td>21.020000</td>\n",
              "      <td>19.709999</td>\n",
              "      <td>20.480000</td>\n",
              "      <td>20.480000</td>\n",
              "      <td>100340700</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1245</th>\n",
              "      <td>20.870001</td>\n",
              "      <td>19.760000</td>\n",
              "      <td>19.860001</td>\n",
              "      <td>19.860001</td>\n",
              "      <td>88108300</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1246</th>\n",
              "      <td>20.700001</td>\n",
              "      <td>19.520000</td>\n",
              "      <td>19.900000</td>\n",
              "      <td>19.900000</td>\n",
              "      <td>84713600</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1247</th>\n",
              "      <td>20.020000</td>\n",
              "      <td>18.639999</td>\n",
              "      <td>18.830000</td>\n",
              "      <td>18.830000</td>\n",
              "      <td>115437900</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1248</th>\n",
              "      <td>19.840000</td>\n",
              "      <td>18.879999</td>\n",
              "      <td>19.500000</td>\n",
              "      <td>19.500000</td>\n",
              "      <td>101512900</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1249</th>\n",
              "      <td>19.719999</td>\n",
              "      <td>18.000000</td>\n",
              "      <td>18.160000</td>\n",
              "      <td>18.160000</td>\n",
              "      <td>120644500</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1250</th>\n",
              "      <td>18.860001</td>\n",
              "      <td>17.340000</td>\n",
              "      <td>17.940001</td>\n",
              "      <td>17.940001</td>\n",
              "      <td>119394500</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1251</th>\n",
              "      <td>18.340000</td>\n",
              "      <td>16.760000</td>\n",
              "      <td>16.930000</td>\n",
              "      <td>16.930000</td>\n",
              "      <td>132246000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1252</th>\n",
              "      <td>17.219999</td>\n",
              "      <td>16.370001</td>\n",
              "      <td>16.650000</td>\n",
              "      <td>16.650000</td>\n",
              "      <td>62933100</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1253</th>\n",
              "      <td>17.910000</td>\n",
              "      <td>16.030001</td>\n",
              "      <td>17.900000</td>\n",
              "      <td>17.900000</td>\n",
              "      <td>108811800</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1254</th>\n",
              "      <td>17.740000</td>\n",
              "      <td>16.440001</td>\n",
              "      <td>17.490000</td>\n",
              "      <td>17.490000</td>\n",
              "      <td>111373000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1255</th>\n",
              "      <td>18.309999</td>\n",
              "      <td>17.139999</td>\n",
              "      <td>17.820000</td>\n",
              "      <td>17.820000</td>\n",
              "      <td>109214400</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1256</th>\n",
              "      <td>18.510000</td>\n",
              "      <td>17.850000</td>\n",
              "      <td>18.459999</td>\n",
              "      <td>18.459999</td>\n",
              "      <td>84732200</td>\n",
              "    </tr>\n",
              "  </tbody>\n",
              "</table>\n",
              "<p>1257 rows × 5 columns</p>\n",
              "</div>"
            ],
            "text/plain": [
              "           High        Low      Close  Adj Close     Volume\n",
              "0      4.000000   3.880000   4.000000   4.000000   22887200\n",
              "1      4.180000   3.990000   4.130000   4.130000   42398300\n",
              "2      4.250000   4.110000   4.180000   4.180000   42932100\n",
              "3      4.260000   4.140000   4.180000   4.180000   30678700\n",
              "4      4.230000   4.050000   4.090000   4.090000   30667600\n",
              "5      4.200000   4.070000   4.170000   4.170000   20840800\n",
              "6      4.200000   4.090000   4.130000   4.130000   22856100\n",
              "7      4.300000   4.130000   4.300000   4.300000   42434800\n",
              "8      4.600000   4.320000   4.470000   4.470000   66613100\n",
              "9      4.510000   4.320000   4.380000   4.380000   46975600\n",
              "10     4.350000   4.110000   4.180000   4.180000   45842700\n",
              "11     4.340000   4.130000   4.170000   4.170000   58702900\n",
              "12     3.820000   3.660000   3.670000   3.670000   86329500\n",
              "13     3.680000   3.580000   3.620000   3.620000   29844700\n",
              "14     3.610000   3.410000   3.470000   3.470000   48095800\n",
              "15     3.490000   3.350000   3.410000   3.410000   31332300\n",
              "16     3.570000   3.410000   3.540000   3.540000   27962600\n",
              "17     3.560000   3.450000   3.480000   3.480000   21765000\n",
              "18     3.520000   3.450000   3.480000   3.480000   17111700\n",
              "19     3.470000   3.430000   3.430000   3.430000   13602100\n",
              "20     3.440000   3.330000   3.330000   3.330000   22280200\n",
              "21     3.430000   3.300000   3.370000   3.370000   22681000\n",
              "22     3.370000   3.290000   3.310000   3.310000   14858900\n",
              "23     3.460000   3.320000   3.410000   3.410000   16072900\n",
              "24     3.500000   3.420000   3.470000   3.470000   23119700\n",
              "25     3.640000   3.450000   3.630000   3.630000   21241100\n",
              "26     3.750000   3.650000   3.700000   3.700000   34198100\n",
              "27     3.730000   3.630000   3.690000   3.690000   18321300\n",
              "28     3.710000   3.640000   3.700000   3.700000   13368600\n",
              "29     3.720000   3.640000   3.690000   3.690000   12387900\n",
              "...         ...        ...        ...        ...        ...\n",
              "1227  21.770000  20.420000  21.490000  21.490000   97715500\n",
              "1228  20.969999  19.719999  20.660000  20.660000  112376600\n",
              "1229  20.590000  19.090000  19.110001  19.110001   93578200\n",
              "1230  19.580000  17.180000  19.209999  19.209999  109869400\n",
              "1231  20.309999  18.500000  18.730000  18.730000   81585600\n",
              "1232  19.830000  18.559999  19.379999  19.379999   54611300\n",
              "1233  20.190001  19.110001  20.080000  20.080000   83211000\n",
              "1234  21.450001  19.730000  21.049999  21.049999  119230100\n",
              "1235  21.879999  20.180000  21.340000  21.340000  134425300\n",
              "1236  21.610001  20.730000  21.430000  21.430000   79853700\n",
              "1237  21.360001  20.520000  21.299999  21.299999   82370700\n",
              "1238  23.750000  22.370001  23.709999  23.709999  139607400\n",
              "1239  23.420000  21.070000  21.120001  21.120001  127392900\n",
              "1240  21.410000  20.059999  21.299999  21.299999  103434700\n",
              "1241  21.379999  19.170000  19.459999  19.459999  105764500\n",
              "1242  20.129999  19.270000  19.990000  19.990000   77984500\n",
              "1243  21.139999  19.690001  19.980000  19.980000   88027400\n",
              "1244  21.020000  19.709999  20.480000  20.480000  100340700\n",
              "1245  20.870001  19.760000  19.860001  19.860001   88108300\n",
              "1246  20.700001  19.520000  19.900000  19.900000   84713600\n",
              "1247  20.020000  18.639999  18.830000  18.830000  115437900\n",
              "1248  19.840000  18.879999  19.500000  19.500000  101512900\n",
              "1249  19.719999  18.000000  18.160000  18.160000  120644500\n",
              "1250  18.860001  17.340000  17.940001  17.940001  119394500\n",
              "1251  18.340000  16.760000  16.930000  16.930000  132246000\n",
              "1252  17.219999  16.370001  16.650000  16.650000   62933100\n",
              "1253  17.910000  16.030001  17.900000  17.900000  108811800\n",
              "1254  17.740000  16.440001  17.490000  17.490000  111373000\n",
              "1255  18.309999  17.139999  17.820000  17.820000  109214400\n",
              "1256  18.510000  17.850000  18.459999  18.459999   84732200\n",
              "\n[1257 rows x 5 columns]"
            ]
          },
          "metadata": {}
        }
      ],
      "execution_count": 29,
      "metadata": {
        "collapsed": false,
        "outputHidden": false,
        "inputHidden": false
      }
    },
    {
      "cell_type": "code",
      "source": [
        "# multiple rows and multiple columns\n",
        "df.loc[0:2, 'High':'Adj Close']"
      ],
      "outputs": [
        {
          "output_type": "execute_result",
          "execution_count": 31,
          "data": {
            "text/html": [
              "<div>\n",
              "<style scoped>\n",
              "    .dataframe tbody tr th:only-of-type {\n",
              "        vertical-align: middle;\n",
              "    }\n",
              "\n",
              "    .dataframe tbody tr th {\n",
              "        vertical-align: top;\n",
              "    }\n",
              "\n",
              "    .dataframe thead th {\n",
              "        text-align: right;\n",
              "    }\n",
              "</style>\n",
              "<table border=\"1\" class=\"dataframe\">\n",
              "  <thead>\n",
              "    <tr style=\"text-align: right;\">\n",
              "      <th></th>\n",
              "      <th>High</th>\n",
              "      <th>Low</th>\n",
              "      <th>Close</th>\n",
              "      <th>Adj Close</th>\n",
              "    </tr>\n",
              "  </thead>\n",
              "  <tbody>\n",
              "    <tr>\n",
              "      <th>0</th>\n",
              "      <td>4.00</td>\n",
              "      <td>3.88</td>\n",
              "      <td>4.00</td>\n",
              "      <td>4.00</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1</th>\n",
              "      <td>4.18</td>\n",
              "      <td>3.99</td>\n",
              "      <td>4.13</td>\n",
              "      <td>4.13</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>2</th>\n",
              "      <td>4.25</td>\n",
              "      <td>4.11</td>\n",
              "      <td>4.18</td>\n",
              "      <td>4.18</td>\n",
              "    </tr>\n",
              "  </tbody>\n",
              "</table>\n",
              "</div>"
            ],
            "text/plain": [
              "   High   Low  Close  Adj Close\n",
              "0  4.00  3.88   4.00       4.00\n",
              "1  4.18  3.99   4.13       4.13\n",
              "2  4.25  4.11   4.18       4.18"
            ]
          },
          "metadata": {}
        }
      ],
      "execution_count": 31,
      "metadata": {
        "collapsed": false,
        "outputHidden": false,
        "inputHidden": false
      }
    },
    {
      "cell_type": "code",
      "source": [
        "# Find Particulare number in column and row\n",
        "df[df.Open==4.00]"
      ],
      "outputs": [
        {
          "output_type": "execute_result",
          "execution_count": 32,
          "data": {
            "text/html": [
              "<div>\n",
              "<style scoped>\n",
              "    .dataframe tbody tr th:only-of-type {\n",
              "        vertical-align: middle;\n",
              "    }\n",
              "\n",
              "    .dataframe tbody tr th {\n",
              "        vertical-align: top;\n",
              "    }\n",
              "\n",
              "    .dataframe thead th {\n",
              "        text-align: right;\n",
              "    }\n",
              "</style>\n",
              "<table border=\"1\" class=\"dataframe\">\n",
              "  <thead>\n",
              "    <tr style=\"text-align: right;\">\n",
              "      <th></th>\n",
              "      <th>Date</th>\n",
              "      <th>Open</th>\n",
              "      <th>High</th>\n",
              "      <th>Low</th>\n",
              "      <th>Close</th>\n",
              "      <th>Adj Close</th>\n",
              "      <th>Volume</th>\n",
              "      <th>Open_Close</th>\n",
              "      <th>High_Low</th>\n",
              "      <th>Increase_Decrease</th>\n",
              "      <th>Buy_Sell_on_Open</th>\n",
              "      <th>Buy_Sell</th>\n",
              "      <th>Returns</th>\n",
              "    </tr>\n",
              "  </thead>\n",
              "  <tbody>\n",
              "    <tr>\n",
              "      <th>80</th>\n",
              "      <td>2014-04-30</td>\n",
              "      <td>4.0</td>\n",
              "      <td>4.1</td>\n",
              "      <td>3.99</td>\n",
              "      <td>4.09</td>\n",
              "      <td>4.09</td>\n",
              "      <td>18419200</td>\n",
              "      <td>-0.0225</td>\n",
              "      <td>0.027569</td>\n",
              "      <td>1</td>\n",
              "      <td>1</td>\n",
              "      <td>1</td>\n",
              "      <td>0.014888</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>93</th>\n",
              "      <td>2014-05-19</td>\n",
              "      <td>4.0</td>\n",
              "      <td>4.1</td>\n",
              "      <td>3.96</td>\n",
              "      <td>4.09</td>\n",
              "      <td>4.09</td>\n",
              "      <td>18171000</td>\n",
              "      <td>-0.0225</td>\n",
              "      <td>0.035354</td>\n",
              "      <td>0</td>\n",
              "      <td>1</td>\n",
              "      <td>0</td>\n",
              "      <td>0.017413</td>\n",
              "    </tr>\n",
              "  </tbody>\n",
              "</table>\n",
              "</div>"
            ],
            "text/plain": [
              "         Date  Open  High   Low  Close  Adj Close    Volume  Open_Close  \\\n",
              "80 2014-04-30   4.0   4.1  3.99   4.09       4.09  18419200     -0.0225   \n",
              "93 2014-05-19   4.0   4.1  3.96   4.09       4.09  18171000     -0.0225   \n",
              "\n",
              "    High_Low  Increase_Decrease  Buy_Sell_on_Open  Buy_Sell   Returns  \n",
              "80  0.027569                  1                 1         1  0.014888  \n",
              "93  0.035354                  0                 1         0  0.017413  "
            ]
          },
          "metadata": {}
        }
      ],
      "execution_count": 32,
      "metadata": {
        "collapsed": false,
        "outputHidden": false,
        "inputHidden": false
      }
    },
    {
      "cell_type": "code",
      "source": [
        "df.loc[df.Open==4.30, :]"
      ],
      "outputs": [
        {
          "output_type": "execute_result",
          "execution_count": 33,
          "data": {
            "text/html": [
              "<div>\n",
              "<style scoped>\n",
              "    .dataframe tbody tr th:only-of-type {\n",
              "        vertical-align: middle;\n",
              "    }\n",
              "\n",
              "    .dataframe tbody tr th {\n",
              "        vertical-align: top;\n",
              "    }\n",
              "\n",
              "    .dataframe thead th {\n",
              "        text-align: right;\n",
              "    }\n",
              "</style>\n",
              "<table border=\"1\" class=\"dataframe\">\n",
              "  <thead>\n",
              "    <tr style=\"text-align: right;\">\n",
              "      <th></th>\n",
              "      <th>Date</th>\n",
              "      <th>Open</th>\n",
              "      <th>High</th>\n",
              "      <th>Low</th>\n",
              "      <th>Close</th>\n",
              "      <th>Adj Close</th>\n",
              "      <th>Volume</th>\n",
              "      <th>Open_Close</th>\n",
              "      <th>High_Low</th>\n",
              "      <th>Increase_Decrease</th>\n",
              "      <th>Buy_Sell_on_Open</th>\n",
              "      <th>Buy_Sell</th>\n",
              "      <th>Returns</th>\n",
              "    </tr>\n",
              "  </thead>\n",
              "  <tbody>\n",
              "    <tr>\n",
              "      <th>130</th>\n",
              "      <td>2014-07-11</td>\n",
              "      <td>4.3</td>\n",
              "      <td>4.4</td>\n",
              "      <td>4.29</td>\n",
              "      <td>4.37</td>\n",
              "      <td>4.37</td>\n",
              "      <td>22425600</td>\n",
              "      <td>-0.016279</td>\n",
              "      <td>0.025641</td>\n",
              "      <td>1</td>\n",
              "      <td>1</td>\n",
              "      <td>1</td>\n",
              "      <td>0.018648</td>\n",
              "    </tr>\n",
              "  </tbody>\n",
              "</table>\n",
              "</div>"
            ],
            "text/plain": [
              "          Date  Open  High   Low  Close  Adj Close    Volume  Open_Close  \\\n",
              "130 2014-07-11   4.3   4.4  4.29   4.37       4.37  22425600   -0.016279   \n",
              "\n",
              "     High_Low  Increase_Decrease  Buy_Sell_on_Open  Buy_Sell   Returns  \n",
              "130  0.025641                  1                 1         1  0.018648  "
            ]
          },
          "metadata": {}
        }
      ],
      "execution_count": 33,
      "metadata": {
        "collapsed": false,
        "outputHidden": false,
        "inputHidden": false
      }
    },
    {
      "cell_type": "code",
      "source": [
        "df.iloc[:, [0, 3]]"
      ],
      "outputs": [
        {
          "output_type": "execute_result",
          "execution_count": 40,
          "data": {
            "text/html": [
              "<div>\n",
              "<style scoped>\n",
              "    .dataframe tbody tr th:only-of-type {\n",
              "        vertical-align: middle;\n",
              "    }\n",
              "\n",
              "    .dataframe tbody tr th {\n",
              "        vertical-align: top;\n",
              "    }\n",
              "\n",
              "    .dataframe thead th {\n",
              "        text-align: right;\n",
              "    }\n",
              "</style>\n",
              "<table border=\"1\" class=\"dataframe\">\n",
              "  <thead>\n",
              "    <tr style=\"text-align: right;\">\n",
              "      <th></th>\n",
              "      <th>Date</th>\n",
              "      <th>Low</th>\n",
              "    </tr>\n",
              "  </thead>\n",
              "  <tbody>\n",
              "    <tr>\n",
              "      <th>0</th>\n",
              "      <td>2014-01-03</td>\n",
              "      <td>3.880000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1</th>\n",
              "      <td>2014-01-06</td>\n",
              "      <td>3.990000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>2</th>\n",
              "      <td>2014-01-07</td>\n",
              "      <td>4.110000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>3</th>\n",
              "      <td>2014-01-08</td>\n",
              "      <td>4.140000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>4</th>\n",
              "      <td>2014-01-09</td>\n",
              "      <td>4.050000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>5</th>\n",
              "      <td>2014-01-10</td>\n",
              "      <td>4.070000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>6</th>\n",
              "      <td>2014-01-13</td>\n",
              "      <td>4.090000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>7</th>\n",
              "      <td>2014-01-14</td>\n",
              "      <td>4.130000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>8</th>\n",
              "      <td>2014-01-15</td>\n",
              "      <td>4.320000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>9</th>\n",
              "      <td>2014-01-16</td>\n",
              "      <td>4.320000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>10</th>\n",
              "      <td>2014-01-17</td>\n",
              "      <td>4.110000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>11</th>\n",
              "      <td>2014-01-21</td>\n",
              "      <td>4.130000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>12</th>\n",
              "      <td>2014-01-22</td>\n",
              "      <td>3.660000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>13</th>\n",
              "      <td>2014-01-23</td>\n",
              "      <td>3.580000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>14</th>\n",
              "      <td>2014-01-24</td>\n",
              "      <td>3.410000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>15</th>\n",
              "      <td>2014-01-27</td>\n",
              "      <td>3.350000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>16</th>\n",
              "      <td>2014-01-28</td>\n",
              "      <td>3.410000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>17</th>\n",
              "      <td>2014-01-29</td>\n",
              "      <td>3.450000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>18</th>\n",
              "      <td>2014-01-30</td>\n",
              "      <td>3.450000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>19</th>\n",
              "      <td>2014-01-31</td>\n",
              "      <td>3.430000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>20</th>\n",
              "      <td>2014-02-03</td>\n",
              "      <td>3.330000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>21</th>\n",
              "      <td>2014-02-04</td>\n",
              "      <td>3.300000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>22</th>\n",
              "      <td>2014-02-05</td>\n",
              "      <td>3.290000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>23</th>\n",
              "      <td>2014-02-06</td>\n",
              "      <td>3.320000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>24</th>\n",
              "      <td>2014-02-07</td>\n",
              "      <td>3.420000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>25</th>\n",
              "      <td>2014-02-10</td>\n",
              "      <td>3.450000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>26</th>\n",
              "      <td>2014-02-11</td>\n",
              "      <td>3.650000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>27</th>\n",
              "      <td>2014-02-12</td>\n",
              "      <td>3.630000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>28</th>\n",
              "      <td>2014-02-13</td>\n",
              "      <td>3.640000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>29</th>\n",
              "      <td>2014-02-14</td>\n",
              "      <td>3.640000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>...</th>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1227</th>\n",
              "      <td>2018-11-15</td>\n",
              "      <td>20.420000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1228</th>\n",
              "      <td>2018-11-16</td>\n",
              "      <td>19.719999</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1229</th>\n",
              "      <td>2018-11-19</td>\n",
              "      <td>19.090000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1230</th>\n",
              "      <td>2018-11-20</td>\n",
              "      <td>17.180000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1231</th>\n",
              "      <td>2018-11-21</td>\n",
              "      <td>18.500000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1232</th>\n",
              "      <td>2018-11-23</td>\n",
              "      <td>18.559999</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1233</th>\n",
              "      <td>2018-11-26</td>\n",
              "      <td>19.110001</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1234</th>\n",
              "      <td>2018-11-27</td>\n",
              "      <td>19.730000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1235</th>\n",
              "      <td>2018-11-28</td>\n",
              "      <td>20.180000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1236</th>\n",
              "      <td>2018-11-29</td>\n",
              "      <td>20.730000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1237</th>\n",
              "      <td>2018-11-30</td>\n",
              "      <td>20.520000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1238</th>\n",
              "      <td>2018-12-03</td>\n",
              "      <td>22.370001</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1239</th>\n",
              "      <td>2018-12-04</td>\n",
              "      <td>21.070000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1240</th>\n",
              "      <td>2018-12-06</td>\n",
              "      <td>20.059999</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1241</th>\n",
              "      <td>2018-12-07</td>\n",
              "      <td>19.170000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1242</th>\n",
              "      <td>2018-12-10</td>\n",
              "      <td>19.270000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1243</th>\n",
              "      <td>2018-12-11</td>\n",
              "      <td>19.690001</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1244</th>\n",
              "      <td>2018-12-12</td>\n",
              "      <td>19.709999</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1245</th>\n",
              "      <td>2018-12-13</td>\n",
              "      <td>19.760000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1246</th>\n",
              "      <td>2018-12-14</td>\n",
              "      <td>19.520000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1247</th>\n",
              "      <td>2018-12-17</td>\n",
              "      <td>18.639999</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1248</th>\n",
              "      <td>2018-12-18</td>\n",
              "      <td>18.879999</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1249</th>\n",
              "      <td>2018-12-19</td>\n",
              "      <td>18.000000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1250</th>\n",
              "      <td>2018-12-20</td>\n",
              "      <td>17.340000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1251</th>\n",
              "      <td>2018-12-21</td>\n",
              "      <td>16.760000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1252</th>\n",
              "      <td>2018-12-24</td>\n",
              "      <td>16.370001</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1253</th>\n",
              "      <td>2018-12-26</td>\n",
              "      <td>16.030001</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1254</th>\n",
              "      <td>2018-12-27</td>\n",
              "      <td>16.440001</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1255</th>\n",
              "      <td>2018-12-28</td>\n",
              "      <td>17.139999</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1256</th>\n",
              "      <td>2018-12-31</td>\n",
              "      <td>17.850000</td>\n",
              "    </tr>\n",
              "  </tbody>\n",
              "</table>\n",
              "<p>1257 rows × 2 columns</p>\n",
              "</div>"
            ],
            "text/plain": [
              "           Date        Low\n",
              "0    2014-01-03   3.880000\n",
              "1    2014-01-06   3.990000\n",
              "2    2014-01-07   4.110000\n",
              "3    2014-01-08   4.140000\n",
              "4    2014-01-09   4.050000\n",
              "5    2014-01-10   4.070000\n",
              "6    2014-01-13   4.090000\n",
              "7    2014-01-14   4.130000\n",
              "8    2014-01-15   4.320000\n",
              "9    2014-01-16   4.320000\n",
              "10   2014-01-17   4.110000\n",
              "11   2014-01-21   4.130000\n",
              "12   2014-01-22   3.660000\n",
              "13   2014-01-23   3.580000\n",
              "14   2014-01-24   3.410000\n",
              "15   2014-01-27   3.350000\n",
              "16   2014-01-28   3.410000\n",
              "17   2014-01-29   3.450000\n",
              "18   2014-01-30   3.450000\n",
              "19   2014-01-31   3.430000\n",
              "20   2014-02-03   3.330000\n",
              "21   2014-02-04   3.300000\n",
              "22   2014-02-05   3.290000\n",
              "23   2014-02-06   3.320000\n",
              "24   2014-02-07   3.420000\n",
              "25   2014-02-10   3.450000\n",
              "26   2014-02-11   3.650000\n",
              "27   2014-02-12   3.630000\n",
              "28   2014-02-13   3.640000\n",
              "29   2014-02-14   3.640000\n",
              "...         ...        ...\n",
              "1227 2018-11-15  20.420000\n",
              "1228 2018-11-16  19.719999\n",
              "1229 2018-11-19  19.090000\n",
              "1230 2018-11-20  17.180000\n",
              "1231 2018-11-21  18.500000\n",
              "1232 2018-11-23  18.559999\n",
              "1233 2018-11-26  19.110001\n",
              "1234 2018-11-27  19.730000\n",
              "1235 2018-11-28  20.180000\n",
              "1236 2018-11-29  20.730000\n",
              "1237 2018-11-30  20.520000\n",
              "1238 2018-12-03  22.370001\n",
              "1239 2018-12-04  21.070000\n",
              "1240 2018-12-06  20.059999\n",
              "1241 2018-12-07  19.170000\n",
              "1242 2018-12-10  19.270000\n",
              "1243 2018-12-11  19.690001\n",
              "1244 2018-12-12  19.709999\n",
              "1245 2018-12-13  19.760000\n",
              "1246 2018-12-14  19.520000\n",
              "1247 2018-12-17  18.639999\n",
              "1248 2018-12-18  18.879999\n",
              "1249 2018-12-19  18.000000\n",
              "1250 2018-12-20  17.340000\n",
              "1251 2018-12-21  16.760000\n",
              "1252 2018-12-24  16.370001\n",
              "1253 2018-12-26  16.030001\n",
              "1254 2018-12-27  16.440001\n",
              "1255 2018-12-28  17.139999\n",
              "1256 2018-12-31  17.850000\n",
              "\n[1257 rows x 2 columns]"
            ]
          },
          "metadata": {}
        }
      ],
      "execution_count": 40,
      "metadata": {
        "collapsed": false,
        "outputHidden": false,
        "inputHidden": false
      }
    },
    {
      "cell_type": "code",
      "source": [
        "df.iloc[:, 0:4]"
      ],
      "outputs": [
        {
          "output_type": "execute_result",
          "execution_count": 41,
          "data": {
            "text/html": [
              "<div>\n",
              "<style scoped>\n",
              "    .dataframe tbody tr th:only-of-type {\n",
              "        vertical-align: middle;\n",
              "    }\n",
              "\n",
              "    .dataframe tbody tr th {\n",
              "        vertical-align: top;\n",
              "    }\n",
              "\n",
              "    .dataframe thead th {\n",
              "        text-align: right;\n",
              "    }\n",
              "</style>\n",
              "<table border=\"1\" class=\"dataframe\">\n",
              "  <thead>\n",
              "    <tr style=\"text-align: right;\">\n",
              "      <th></th>\n",
              "      <th>Date</th>\n",
              "      <th>Open</th>\n",
              "      <th>High</th>\n",
              "      <th>Low</th>\n",
              "    </tr>\n",
              "  </thead>\n",
              "  <tbody>\n",
              "    <tr>\n",
              "      <th>0</th>\n",
              "      <td>2014-01-03</td>\n",
              "      <td>3.980000</td>\n",
              "      <td>4.000000</td>\n",
              "      <td>3.880000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1</th>\n",
              "      <td>2014-01-06</td>\n",
              "      <td>4.010000</td>\n",
              "      <td>4.180000</td>\n",
              "      <td>3.990000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>2</th>\n",
              "      <td>2014-01-07</td>\n",
              "      <td>4.190000</td>\n",
              "      <td>4.250000</td>\n",
              "      <td>4.110000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>3</th>\n",
              "      <td>2014-01-08</td>\n",
              "      <td>4.230000</td>\n",
              "      <td>4.260000</td>\n",
              "      <td>4.140000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>4</th>\n",
              "      <td>2014-01-09</td>\n",
              "      <td>4.200000</td>\n",
              "      <td>4.230000</td>\n",
              "      <td>4.050000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>5</th>\n",
              "      <td>2014-01-10</td>\n",
              "      <td>4.090000</td>\n",
              "      <td>4.200000</td>\n",
              "      <td>4.070000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>6</th>\n",
              "      <td>2014-01-13</td>\n",
              "      <td>4.190000</td>\n",
              "      <td>4.200000</td>\n",
              "      <td>4.090000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>7</th>\n",
              "      <td>2014-01-14</td>\n",
              "      <td>4.140000</td>\n",
              "      <td>4.300000</td>\n",
              "      <td>4.130000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>8</th>\n",
              "      <td>2014-01-15</td>\n",
              "      <td>4.340000</td>\n",
              "      <td>4.600000</td>\n",
              "      <td>4.320000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>9</th>\n",
              "      <td>2014-01-16</td>\n",
              "      <td>4.500000</td>\n",
              "      <td>4.510000</td>\n",
              "      <td>4.320000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>10</th>\n",
              "      <td>2014-01-17</td>\n",
              "      <td>4.150000</td>\n",
              "      <td>4.350000</td>\n",
              "      <td>4.110000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>11</th>\n",
              "      <td>2014-01-21</td>\n",
              "      <td>4.310000</td>\n",
              "      <td>4.340000</td>\n",
              "      <td>4.130000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>12</th>\n",
              "      <td>2014-01-22</td>\n",
              "      <td>3.790000</td>\n",
              "      <td>3.820000</td>\n",
              "      <td>3.660000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>13</th>\n",
              "      <td>2014-01-23</td>\n",
              "      <td>3.670000</td>\n",
              "      <td>3.680000</td>\n",
              "      <td>3.580000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>14</th>\n",
              "      <td>2014-01-24</td>\n",
              "      <td>3.600000</td>\n",
              "      <td>3.610000</td>\n",
              "      <td>3.410000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>15</th>\n",
              "      <td>2014-01-27</td>\n",
              "      <td>3.480000</td>\n",
              "      <td>3.490000</td>\n",
              "      <td>3.350000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>16</th>\n",
              "      <td>2014-01-28</td>\n",
              "      <td>3.430000</td>\n",
              "      <td>3.570000</td>\n",
              "      <td>3.410000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>17</th>\n",
              "      <td>2014-01-29</td>\n",
              "      <td>3.520000</td>\n",
              "      <td>3.560000</td>\n",
              "      <td>3.450000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>18</th>\n",
              "      <td>2014-01-30</td>\n",
              "      <td>3.510000</td>\n",
              "      <td>3.520000</td>\n",
              "      <td>3.450000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>19</th>\n",
              "      <td>2014-01-31</td>\n",
              "      <td>3.450000</td>\n",
              "      <td>3.470000</td>\n",
              "      <td>3.430000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>20</th>\n",
              "      <td>2014-02-03</td>\n",
              "      <td>3.430000</td>\n",
              "      <td>3.440000</td>\n",
              "      <td>3.330000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>21</th>\n",
              "      <td>2014-02-04</td>\n",
              "      <td>3.350000</td>\n",
              "      <td>3.430000</td>\n",
              "      <td>3.300000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>22</th>\n",
              "      <td>2014-02-05</td>\n",
              "      <td>3.360000</td>\n",
              "      <td>3.370000</td>\n",
              "      <td>3.290000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>23</th>\n",
              "      <td>2014-02-06</td>\n",
              "      <td>3.320000</td>\n",
              "      <td>3.460000</td>\n",
              "      <td>3.320000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>24</th>\n",
              "      <td>2014-02-07</td>\n",
              "      <td>3.460000</td>\n",
              "      <td>3.500000</td>\n",
              "      <td>3.420000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>25</th>\n",
              "      <td>2014-02-10</td>\n",
              "      <td>3.500000</td>\n",
              "      <td>3.640000</td>\n",
              "      <td>3.450000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>26</th>\n",
              "      <td>2014-02-11</td>\n",
              "      <td>3.660000</td>\n",
              "      <td>3.750000</td>\n",
              "      <td>3.650000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>27</th>\n",
              "      <td>2014-02-12</td>\n",
              "      <td>3.710000</td>\n",
              "      <td>3.730000</td>\n",
              "      <td>3.630000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>28</th>\n",
              "      <td>2014-02-13</td>\n",
              "      <td>3.640000</td>\n",
              "      <td>3.710000</td>\n",
              "      <td>3.640000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>29</th>\n",
              "      <td>2014-02-14</td>\n",
              "      <td>3.700000</td>\n",
              "      <td>3.720000</td>\n",
              "      <td>3.640000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>...</th>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1227</th>\n",
              "      <td>2018-11-15</td>\n",
              "      <td>20.719999</td>\n",
              "      <td>21.770000</td>\n",
              "      <td>20.420000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1228</th>\n",
              "      <td>2018-11-16</td>\n",
              "      <td>19.870001</td>\n",
              "      <td>20.969999</td>\n",
              "      <td>19.719999</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1229</th>\n",
              "      <td>2018-11-19</td>\n",
              "      <td>20.400000</td>\n",
              "      <td>20.590000</td>\n",
              "      <td>19.090000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1230</th>\n",
              "      <td>2018-11-20</td>\n",
              "      <td>17.400000</td>\n",
              "      <td>19.580000</td>\n",
              "      <td>17.180000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1231</th>\n",
              "      <td>2018-11-21</td>\n",
              "      <td>20.049999</td>\n",
              "      <td>20.309999</td>\n",
              "      <td>18.500000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1232</th>\n",
              "      <td>2018-11-23</td>\n",
              "      <td>18.610001</td>\n",
              "      <td>19.830000</td>\n",
              "      <td>18.559999</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1233</th>\n",
              "      <td>2018-11-26</td>\n",
              "      <td>19.959999</td>\n",
              "      <td>20.190001</td>\n",
              "      <td>19.110001</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1234</th>\n",
              "      <td>2018-11-27</td>\n",
              "      <td>19.770000</td>\n",
              "      <td>21.450001</td>\n",
              "      <td>19.730000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1235</th>\n",
              "      <td>2018-11-28</td>\n",
              "      <td>21.820000</td>\n",
              "      <td>21.879999</td>\n",
              "      <td>20.180000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1236</th>\n",
              "      <td>2018-11-29</td>\n",
              "      <td>21.190001</td>\n",
              "      <td>21.610001</td>\n",
              "      <td>20.730000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1237</th>\n",
              "      <td>2018-11-30</td>\n",
              "      <td>21.299999</td>\n",
              "      <td>21.360001</td>\n",
              "      <td>20.520000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1238</th>\n",
              "      <td>2018-12-03</td>\n",
              "      <td>22.480000</td>\n",
              "      <td>23.750000</td>\n",
              "      <td>22.370001</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1239</th>\n",
              "      <td>2018-12-04</td>\n",
              "      <td>23.350000</td>\n",
              "      <td>23.420000</td>\n",
              "      <td>21.070000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1240</th>\n",
              "      <td>2018-12-06</td>\n",
              "      <td>20.219999</td>\n",
              "      <td>21.410000</td>\n",
              "      <td>20.059999</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1241</th>\n",
              "      <td>2018-12-07</td>\n",
              "      <td>21.299999</td>\n",
              "      <td>21.379999</td>\n",
              "      <td>19.170000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1242</th>\n",
              "      <td>2018-12-10</td>\n",
              "      <td>19.350000</td>\n",
              "      <td>20.129999</td>\n",
              "      <td>19.270000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1243</th>\n",
              "      <td>2018-12-11</td>\n",
              "      <td>20.709999</td>\n",
              "      <td>21.139999</td>\n",
              "      <td>19.690001</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1244</th>\n",
              "      <td>2018-12-12</td>\n",
              "      <td>20.320000</td>\n",
              "      <td>21.020000</td>\n",
              "      <td>19.709999</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1245</th>\n",
              "      <td>2018-12-13</td>\n",
              "      <td>20.629999</td>\n",
              "      <td>20.870001</td>\n",
              "      <td>19.760000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1246</th>\n",
              "      <td>2018-12-14</td>\n",
              "      <td>19.580000</td>\n",
              "      <td>20.700001</td>\n",
              "      <td>19.520000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1247</th>\n",
              "      <td>2018-12-17</td>\n",
              "      <td>20.010000</td>\n",
              "      <td>20.020000</td>\n",
              "      <td>18.639999</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1248</th>\n",
              "      <td>2018-12-18</td>\n",
              "      <td>19.150000</td>\n",
              "      <td>19.840000</td>\n",
              "      <td>18.879999</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1249</th>\n",
              "      <td>2018-12-19</td>\n",
              "      <td>19.440001</td>\n",
              "      <td>19.719999</td>\n",
              "      <td>18.000000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1250</th>\n",
              "      <td>2018-12-20</td>\n",
              "      <td>18.110001</td>\n",
              "      <td>18.860001</td>\n",
              "      <td>17.340000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1251</th>\n",
              "      <td>2018-12-21</td>\n",
              "      <td>18.120001</td>\n",
              "      <td>18.340000</td>\n",
              "      <td>16.760000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1252</th>\n",
              "      <td>2018-12-24</td>\n",
              "      <td>16.520000</td>\n",
              "      <td>17.219999</td>\n",
              "      <td>16.370001</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1253</th>\n",
              "      <td>2018-12-26</td>\n",
              "      <td>16.879999</td>\n",
              "      <td>17.910000</td>\n",
              "      <td>16.030001</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1254</th>\n",
              "      <td>2018-12-27</td>\n",
              "      <td>17.430000</td>\n",
              "      <td>17.740000</td>\n",
              "      <td>16.440001</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1255</th>\n",
              "      <td>2018-12-28</td>\n",
              "      <td>17.530001</td>\n",
              "      <td>18.309999</td>\n",
              "      <td>17.139999</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1256</th>\n",
              "      <td>2018-12-31</td>\n",
              "      <td>18.150000</td>\n",
              "      <td>18.510000</td>\n",
              "      <td>17.850000</td>\n",
              "    </tr>\n",
              "  </tbody>\n",
              "</table>\n",
              "<p>1257 rows × 4 columns</p>\n",
              "</div>"
            ],
            "text/plain": [
              "           Date       Open       High        Low\n",
              "0    2014-01-03   3.980000   4.000000   3.880000\n",
              "1    2014-01-06   4.010000   4.180000   3.990000\n",
              "2    2014-01-07   4.190000   4.250000   4.110000\n",
              "3    2014-01-08   4.230000   4.260000   4.140000\n",
              "4    2014-01-09   4.200000   4.230000   4.050000\n",
              "5    2014-01-10   4.090000   4.200000   4.070000\n",
              "6    2014-01-13   4.190000   4.200000   4.090000\n",
              "7    2014-01-14   4.140000   4.300000   4.130000\n",
              "8    2014-01-15   4.340000   4.600000   4.320000\n",
              "9    2014-01-16   4.500000   4.510000   4.320000\n",
              "10   2014-01-17   4.150000   4.350000   4.110000\n",
              "11   2014-01-21   4.310000   4.340000   4.130000\n",
              "12   2014-01-22   3.790000   3.820000   3.660000\n",
              "13   2014-01-23   3.670000   3.680000   3.580000\n",
              "14   2014-01-24   3.600000   3.610000   3.410000\n",
              "15   2014-01-27   3.480000   3.490000   3.350000\n",
              "16   2014-01-28   3.430000   3.570000   3.410000\n",
              "17   2014-01-29   3.520000   3.560000   3.450000\n",
              "18   2014-01-30   3.510000   3.520000   3.450000\n",
              "19   2014-01-31   3.450000   3.470000   3.430000\n",
              "20   2014-02-03   3.430000   3.440000   3.330000\n",
              "21   2014-02-04   3.350000   3.430000   3.300000\n",
              "22   2014-02-05   3.360000   3.370000   3.290000\n",
              "23   2014-02-06   3.320000   3.460000   3.320000\n",
              "24   2014-02-07   3.460000   3.500000   3.420000\n",
              "25   2014-02-10   3.500000   3.640000   3.450000\n",
              "26   2014-02-11   3.660000   3.750000   3.650000\n",
              "27   2014-02-12   3.710000   3.730000   3.630000\n",
              "28   2014-02-13   3.640000   3.710000   3.640000\n",
              "29   2014-02-14   3.700000   3.720000   3.640000\n",
              "...         ...        ...        ...        ...\n",
              "1227 2018-11-15  20.719999  21.770000  20.420000\n",
              "1228 2018-11-16  19.870001  20.969999  19.719999\n",
              "1229 2018-11-19  20.400000  20.590000  19.090000\n",
              "1230 2018-11-20  17.400000  19.580000  17.180000\n",
              "1231 2018-11-21  20.049999  20.309999  18.500000\n",
              "1232 2018-11-23  18.610001  19.830000  18.559999\n",
              "1233 2018-11-26  19.959999  20.190001  19.110001\n",
              "1234 2018-11-27  19.770000  21.450001  19.730000\n",
              "1235 2018-11-28  21.820000  21.879999  20.180000\n",
              "1236 2018-11-29  21.190001  21.610001  20.730000\n",
              "1237 2018-11-30  21.299999  21.360001  20.520000\n",
              "1238 2018-12-03  22.480000  23.750000  22.370001\n",
              "1239 2018-12-04  23.350000  23.420000  21.070000\n",
              "1240 2018-12-06  20.219999  21.410000  20.059999\n",
              "1241 2018-12-07  21.299999  21.379999  19.170000\n",
              "1242 2018-12-10  19.350000  20.129999  19.270000\n",
              "1243 2018-12-11  20.709999  21.139999  19.690001\n",
              "1244 2018-12-12  20.320000  21.020000  19.709999\n",
              "1245 2018-12-13  20.629999  20.870001  19.760000\n",
              "1246 2018-12-14  19.580000  20.700001  19.520000\n",
              "1247 2018-12-17  20.010000  20.020000  18.639999\n",
              "1248 2018-12-18  19.150000  19.840000  18.879999\n",
              "1249 2018-12-19  19.440001  19.719999  18.000000\n",
              "1250 2018-12-20  18.110001  18.860001  17.340000\n",
              "1251 2018-12-21  18.120001  18.340000  16.760000\n",
              "1252 2018-12-24  16.520000  17.219999  16.370001\n",
              "1253 2018-12-26  16.879999  17.910000  16.030001\n",
              "1254 2018-12-27  17.430000  17.740000  16.440001\n",
              "1255 2018-12-28  17.530001  18.309999  17.139999\n",
              "1256 2018-12-31  18.150000  18.510000  17.850000\n",
              "\n[1257 rows x 4 columns]"
            ]
          },
          "metadata": {}
        }
      ],
      "execution_count": 41,
      "metadata": {
        "collapsed": false,
        "outputHidden": false,
        "inputHidden": false
      }
    },
    {
      "cell_type": "code",
      "source": [
        "df.iloc[0:3, :]"
      ],
      "outputs": [
        {
          "output_type": "execute_result",
          "execution_count": 42,
          "data": {
            "text/html": [
              "<div>\n",
              "<style scoped>\n",
              "    .dataframe tbody tr th:only-of-type {\n",
              "        vertical-align: middle;\n",
              "    }\n",
              "\n",
              "    .dataframe tbody tr th {\n",
              "        vertical-align: top;\n",
              "    }\n",
              "\n",
              "    .dataframe thead th {\n",
              "        text-align: right;\n",
              "    }\n",
              "</style>\n",
              "<table border=\"1\" class=\"dataframe\">\n",
              "  <thead>\n",
              "    <tr style=\"text-align: right;\">\n",
              "      <th></th>\n",
              "      <th>Date</th>\n",
              "      <th>Open</th>\n",
              "      <th>High</th>\n",
              "      <th>Low</th>\n",
              "      <th>Close</th>\n",
              "      <th>Adj Close</th>\n",
              "      <th>Volume</th>\n",
              "      <th>Open_Close</th>\n",
              "      <th>High_Low</th>\n",
              "      <th>Increase_Decrease</th>\n",
              "      <th>Buy_Sell_on_Open</th>\n",
              "      <th>Buy_Sell</th>\n",
              "      <th>Returns</th>\n",
              "    </tr>\n",
              "  </thead>\n",
              "  <tbody>\n",
              "    <tr>\n",
              "      <th>0</th>\n",
              "      <td>2014-01-03</td>\n",
              "      <td>3.98</td>\n",
              "      <td>4.00</td>\n",
              "      <td>3.88</td>\n",
              "      <td>4.00</td>\n",
              "      <td>4.00</td>\n",
              "      <td>22887200</td>\n",
              "      <td>-0.005025</td>\n",
              "      <td>0.030928</td>\n",
              "      <td>1</td>\n",
              "      <td>1</td>\n",
              "      <td>1</td>\n",
              "      <td>0.012658</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1</th>\n",
              "      <td>2014-01-06</td>\n",
              "      <td>4.01</td>\n",
              "      <td>4.18</td>\n",
              "      <td>3.99</td>\n",
              "      <td>4.13</td>\n",
              "      <td>4.13</td>\n",
              "      <td>42398300</td>\n",
              "      <td>-0.029925</td>\n",
              "      <td>0.047619</td>\n",
              "      <td>1</td>\n",
              "      <td>1</td>\n",
              "      <td>1</td>\n",
              "      <td>0.032500</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>2</th>\n",
              "      <td>2014-01-07</td>\n",
              "      <td>4.19</td>\n",
              "      <td>4.25</td>\n",
              "      <td>4.11</td>\n",
              "      <td>4.18</td>\n",
              "      <td>4.18</td>\n",
              "      <td>42932100</td>\n",
              "      <td>0.002387</td>\n",
              "      <td>0.034063</td>\n",
              "      <td>0</td>\n",
              "      <td>1</td>\n",
              "      <td>0</td>\n",
              "      <td>0.012107</td>\n",
              "    </tr>\n",
              "  </tbody>\n",
              "</table>\n",
              "</div>"
            ],
            "text/plain": [
              "        Date  Open  High   Low  Close  Adj Close    Volume  Open_Close  \\\n",
              "0 2014-01-03  3.98  4.00  3.88   4.00       4.00  22887200   -0.005025   \n",
              "1 2014-01-06  4.01  4.18  3.99   4.13       4.13  42398300   -0.029925   \n",
              "2 2014-01-07  4.19  4.25  4.11   4.18       4.18  42932100    0.002387   \n",
              "\n",
              "   High_Low  Increase_Decrease  Buy_Sell_on_Open  Buy_Sell   Returns  \n",
              "0  0.030928                  1                 1         1  0.012658  \n",
              "1  0.047619                  1                 1         1  0.032500  \n",
              "2  0.034063                  0                 1         0  0.012107  "
            ]
          },
          "metadata": {}
        }
      ],
      "execution_count": 42,
      "metadata": {
        "collapsed": false,
        "outputHidden": false,
        "inputHidden": false
      }
    },
    {
      "cell_type": "code",
      "source": [
        "# non-explicit code\n",
        "df[['Open', 'Close']]"
      ],
      "outputs": [
        {
          "output_type": "execute_result",
          "execution_count": 43,
          "data": {
            "text/html": [
              "<div>\n",
              "<style scoped>\n",
              "    .dataframe tbody tr th:only-of-type {\n",
              "        vertical-align: middle;\n",
              "    }\n",
              "\n",
              "    .dataframe tbody tr th {\n",
              "        vertical-align: top;\n",
              "    }\n",
              "\n",
              "    .dataframe thead th {\n",
              "        text-align: right;\n",
              "    }\n",
              "</style>\n",
              "<table border=\"1\" class=\"dataframe\">\n",
              "  <thead>\n",
              "    <tr style=\"text-align: right;\">\n",
              "      <th></th>\n",
              "      <th>Open</th>\n",
              "      <th>Close</th>\n",
              "    </tr>\n",
              "  </thead>\n",
              "  <tbody>\n",
              "    <tr>\n",
              "      <th>0</th>\n",
              "      <td>3.980000</td>\n",
              "      <td>4.000000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1</th>\n",
              "      <td>4.010000</td>\n",
              "      <td>4.130000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>2</th>\n",
              "      <td>4.190000</td>\n",
              "      <td>4.180000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>3</th>\n",
              "      <td>4.230000</td>\n",
              "      <td>4.180000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>4</th>\n",
              "      <td>4.200000</td>\n",
              "      <td>4.090000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>5</th>\n",
              "      <td>4.090000</td>\n",
              "      <td>4.170000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>6</th>\n",
              "      <td>4.190000</td>\n",
              "      <td>4.130000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>7</th>\n",
              "      <td>4.140000</td>\n",
              "      <td>4.300000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>8</th>\n",
              "      <td>4.340000</td>\n",
              "      <td>4.470000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>9</th>\n",
              "      <td>4.500000</td>\n",
              "      <td>4.380000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>10</th>\n",
              "      <td>4.150000</td>\n",
              "      <td>4.180000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>11</th>\n",
              "      <td>4.310000</td>\n",
              "      <td>4.170000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>12</th>\n",
              "      <td>3.790000</td>\n",
              "      <td>3.670000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>13</th>\n",
              "      <td>3.670000</td>\n",
              "      <td>3.620000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>14</th>\n",
              "      <td>3.600000</td>\n",
              "      <td>3.470000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>15</th>\n",
              "      <td>3.480000</td>\n",
              "      <td>3.410000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>16</th>\n",
              "      <td>3.430000</td>\n",
              "      <td>3.540000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>17</th>\n",
              "      <td>3.520000</td>\n",
              "      <td>3.480000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>18</th>\n",
              "      <td>3.510000</td>\n",
              "      <td>3.480000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>19</th>\n",
              "      <td>3.450000</td>\n",
              "      <td>3.430000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>20</th>\n",
              "      <td>3.430000</td>\n",
              "      <td>3.330000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>21</th>\n",
              "      <td>3.350000</td>\n",
              "      <td>3.370000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>22</th>\n",
              "      <td>3.360000</td>\n",
              "      <td>3.310000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>23</th>\n",
              "      <td>3.320000</td>\n",
              "      <td>3.410000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>24</th>\n",
              "      <td>3.460000</td>\n",
              "      <td>3.470000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>25</th>\n",
              "      <td>3.500000</td>\n",
              "      <td>3.630000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>26</th>\n",
              "      <td>3.660000</td>\n",
              "      <td>3.700000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>27</th>\n",
              "      <td>3.710000</td>\n",
              "      <td>3.690000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>28</th>\n",
              "      <td>3.640000</td>\n",
              "      <td>3.700000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>29</th>\n",
              "      <td>3.700000</td>\n",
              "      <td>3.690000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>...</th>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1227</th>\n",
              "      <td>20.719999</td>\n",
              "      <td>21.490000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1228</th>\n",
              "      <td>19.870001</td>\n",
              "      <td>20.660000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1229</th>\n",
              "      <td>20.400000</td>\n",
              "      <td>19.110001</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1230</th>\n",
              "      <td>17.400000</td>\n",
              "      <td>19.209999</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1231</th>\n",
              "      <td>20.049999</td>\n",
              "      <td>18.730000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1232</th>\n",
              "      <td>18.610001</td>\n",
              "      <td>19.379999</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1233</th>\n",
              "      <td>19.959999</td>\n",
              "      <td>20.080000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1234</th>\n",
              "      <td>19.770000</td>\n",
              "      <td>21.049999</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1235</th>\n",
              "      <td>21.820000</td>\n",
              "      <td>21.340000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1236</th>\n",
              "      <td>21.190001</td>\n",
              "      <td>21.430000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1237</th>\n",
              "      <td>21.299999</td>\n",
              "      <td>21.299999</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1238</th>\n",
              "      <td>22.480000</td>\n",
              "      <td>23.709999</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1239</th>\n",
              "      <td>23.350000</td>\n",
              "      <td>21.120001</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1240</th>\n",
              "      <td>20.219999</td>\n",
              "      <td>21.299999</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1241</th>\n",
              "      <td>21.299999</td>\n",
              "      <td>19.459999</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1242</th>\n",
              "      <td>19.350000</td>\n",
              "      <td>19.990000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1243</th>\n",
              "      <td>20.709999</td>\n",
              "      <td>19.980000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1244</th>\n",
              "      <td>20.320000</td>\n",
              "      <td>20.480000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1245</th>\n",
              "      <td>20.629999</td>\n",
              "      <td>19.860001</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1246</th>\n",
              "      <td>19.580000</td>\n",
              "      <td>19.900000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1247</th>\n",
              "      <td>20.010000</td>\n",
              "      <td>18.830000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1248</th>\n",
              "      <td>19.150000</td>\n",
              "      <td>19.500000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1249</th>\n",
              "      <td>19.440001</td>\n",
              "      <td>18.160000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1250</th>\n",
              "      <td>18.110001</td>\n",
              "      <td>17.940001</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1251</th>\n",
              "      <td>18.120001</td>\n",
              "      <td>16.930000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1252</th>\n",
              "      <td>16.520000</td>\n",
              "      <td>16.650000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1253</th>\n",
              "      <td>16.879999</td>\n",
              "      <td>17.900000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1254</th>\n",
              "      <td>17.430000</td>\n",
              "      <td>17.490000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1255</th>\n",
              "      <td>17.530001</td>\n",
              "      <td>17.820000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1256</th>\n",
              "      <td>18.150000</td>\n",
              "      <td>18.459999</td>\n",
              "    </tr>\n",
              "  </tbody>\n",
              "</table>\n",
              "<p>1257 rows × 2 columns</p>\n",
              "</div>"
            ],
            "text/plain": [
              "           Open      Close\n",
              "0      3.980000   4.000000\n",
              "1      4.010000   4.130000\n",
              "2      4.190000   4.180000\n",
              "3      4.230000   4.180000\n",
              "4      4.200000   4.090000\n",
              "5      4.090000   4.170000\n",
              "6      4.190000   4.130000\n",
              "7      4.140000   4.300000\n",
              "8      4.340000   4.470000\n",
              "9      4.500000   4.380000\n",
              "10     4.150000   4.180000\n",
              "11     4.310000   4.170000\n",
              "12     3.790000   3.670000\n",
              "13     3.670000   3.620000\n",
              "14     3.600000   3.470000\n",
              "15     3.480000   3.410000\n",
              "16     3.430000   3.540000\n",
              "17     3.520000   3.480000\n",
              "18     3.510000   3.480000\n",
              "19     3.450000   3.430000\n",
              "20     3.430000   3.330000\n",
              "21     3.350000   3.370000\n",
              "22     3.360000   3.310000\n",
              "23     3.320000   3.410000\n",
              "24     3.460000   3.470000\n",
              "25     3.500000   3.630000\n",
              "26     3.660000   3.700000\n",
              "27     3.710000   3.690000\n",
              "28     3.640000   3.700000\n",
              "29     3.700000   3.690000\n",
              "...         ...        ...\n",
              "1227  20.719999  21.490000\n",
              "1228  19.870001  20.660000\n",
              "1229  20.400000  19.110001\n",
              "1230  17.400000  19.209999\n",
              "1231  20.049999  18.730000\n",
              "1232  18.610001  19.379999\n",
              "1233  19.959999  20.080000\n",
              "1234  19.770000  21.049999\n",
              "1235  21.820000  21.340000\n",
              "1236  21.190001  21.430000\n",
              "1237  21.299999  21.299999\n",
              "1238  22.480000  23.709999\n",
              "1239  23.350000  21.120001\n",
              "1240  20.219999  21.299999\n",
              "1241  21.299999  19.459999\n",
              "1242  19.350000  19.990000\n",
              "1243  20.709999  19.980000\n",
              "1244  20.320000  20.480000\n",
              "1245  20.629999  19.860001\n",
              "1246  19.580000  19.900000\n",
              "1247  20.010000  18.830000\n",
              "1248  19.150000  19.500000\n",
              "1249  19.440001  18.160000\n",
              "1250  18.110001  17.940001\n",
              "1251  18.120001  16.930000\n",
              "1252  16.520000  16.650000\n",
              "1253  16.879999  17.900000\n",
              "1254  17.430000  17.490000\n",
              "1255  17.530001  17.820000\n",
              "1256  18.150000  18.459999\n",
              "\n[1257 rows x 2 columns]"
            ]
          },
          "metadata": {}
        }
      ],
      "execution_count": 43,
      "metadata": {
        "collapsed": false,
        "outputHidden": false,
        "inputHidden": false
      }
    },
    {
      "cell_type": "code",
      "source": [
        "# explicit code\n",
        "df.loc[:, ['Open', 'Close']]"
      ],
      "outputs": [
        {
          "output_type": "execute_result",
          "execution_count": 45,
          "data": {
            "text/html": [
              "<div>\n",
              "<style scoped>\n",
              "    .dataframe tbody tr th:only-of-type {\n",
              "        vertical-align: middle;\n",
              "    }\n",
              "\n",
              "    .dataframe tbody tr th {\n",
              "        vertical-align: top;\n",
              "    }\n",
              "\n",
              "    .dataframe thead th {\n",
              "        text-align: right;\n",
              "    }\n",
              "</style>\n",
              "<table border=\"1\" class=\"dataframe\">\n",
              "  <thead>\n",
              "    <tr style=\"text-align: right;\">\n",
              "      <th></th>\n",
              "      <th>Open</th>\n",
              "      <th>Close</th>\n",
              "    </tr>\n",
              "  </thead>\n",
              "  <tbody>\n",
              "    <tr>\n",
              "      <th>0</th>\n",
              "      <td>3.980000</td>\n",
              "      <td>4.000000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1</th>\n",
              "      <td>4.010000</td>\n",
              "      <td>4.130000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>2</th>\n",
              "      <td>4.190000</td>\n",
              "      <td>4.180000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>3</th>\n",
              "      <td>4.230000</td>\n",
              "      <td>4.180000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>4</th>\n",
              "      <td>4.200000</td>\n",
              "      <td>4.090000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>5</th>\n",
              "      <td>4.090000</td>\n",
              "      <td>4.170000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>6</th>\n",
              "      <td>4.190000</td>\n",
              "      <td>4.130000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>7</th>\n",
              "      <td>4.140000</td>\n",
              "      <td>4.300000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>8</th>\n",
              "      <td>4.340000</td>\n",
              "      <td>4.470000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>9</th>\n",
              "      <td>4.500000</td>\n",
              "      <td>4.380000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>10</th>\n",
              "      <td>4.150000</td>\n",
              "      <td>4.180000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>11</th>\n",
              "      <td>4.310000</td>\n",
              "      <td>4.170000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>12</th>\n",
              "      <td>3.790000</td>\n",
              "      <td>3.670000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>13</th>\n",
              "      <td>3.670000</td>\n",
              "      <td>3.620000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>14</th>\n",
              "      <td>3.600000</td>\n",
              "      <td>3.470000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>15</th>\n",
              "      <td>3.480000</td>\n",
              "      <td>3.410000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>16</th>\n",
              "      <td>3.430000</td>\n",
              "      <td>3.540000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>17</th>\n",
              "      <td>3.520000</td>\n",
              "      <td>3.480000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>18</th>\n",
              "      <td>3.510000</td>\n",
              "      <td>3.480000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>19</th>\n",
              "      <td>3.450000</td>\n",
              "      <td>3.430000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>20</th>\n",
              "      <td>3.430000</td>\n",
              "      <td>3.330000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>21</th>\n",
              "      <td>3.350000</td>\n",
              "      <td>3.370000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>22</th>\n",
              "      <td>3.360000</td>\n",
              "      <td>3.310000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>23</th>\n",
              "      <td>3.320000</td>\n",
              "      <td>3.410000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>24</th>\n",
              "      <td>3.460000</td>\n",
              "      <td>3.470000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>25</th>\n",
              "      <td>3.500000</td>\n",
              "      <td>3.630000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>26</th>\n",
              "      <td>3.660000</td>\n",
              "      <td>3.700000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>27</th>\n",
              "      <td>3.710000</td>\n",
              "      <td>3.690000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>28</th>\n",
              "      <td>3.640000</td>\n",
              "      <td>3.700000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>29</th>\n",
              "      <td>3.700000</td>\n",
              "      <td>3.690000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>...</th>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1227</th>\n",
              "      <td>20.719999</td>\n",
              "      <td>21.490000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1228</th>\n",
              "      <td>19.870001</td>\n",
              "      <td>20.660000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1229</th>\n",
              "      <td>20.400000</td>\n",
              "      <td>19.110001</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1230</th>\n",
              "      <td>17.400000</td>\n",
              "      <td>19.209999</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1231</th>\n",
              "      <td>20.049999</td>\n",
              "      <td>18.730000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1232</th>\n",
              "      <td>18.610001</td>\n",
              "      <td>19.379999</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1233</th>\n",
              "      <td>19.959999</td>\n",
              "      <td>20.080000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1234</th>\n",
              "      <td>19.770000</td>\n",
              "      <td>21.049999</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1235</th>\n",
              "      <td>21.820000</td>\n",
              "      <td>21.340000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1236</th>\n",
              "      <td>21.190001</td>\n",
              "      <td>21.430000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1237</th>\n",
              "      <td>21.299999</td>\n",
              "      <td>21.299999</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1238</th>\n",
              "      <td>22.480000</td>\n",
              "      <td>23.709999</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1239</th>\n",
              "      <td>23.350000</td>\n",
              "      <td>21.120001</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1240</th>\n",
              "      <td>20.219999</td>\n",
              "      <td>21.299999</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1241</th>\n",
              "      <td>21.299999</td>\n",
              "      <td>19.459999</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1242</th>\n",
              "      <td>19.350000</td>\n",
              "      <td>19.990000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1243</th>\n",
              "      <td>20.709999</td>\n",
              "      <td>19.980000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1244</th>\n",
              "      <td>20.320000</td>\n",
              "      <td>20.480000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1245</th>\n",
              "      <td>20.629999</td>\n",
              "      <td>19.860001</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1246</th>\n",
              "      <td>19.580000</td>\n",
              "      <td>19.900000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1247</th>\n",
              "      <td>20.010000</td>\n",
              "      <td>18.830000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1248</th>\n",
              "      <td>19.150000</td>\n",
              "      <td>19.500000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1249</th>\n",
              "      <td>19.440001</td>\n",
              "      <td>18.160000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1250</th>\n",
              "      <td>18.110001</td>\n",
              "      <td>17.940001</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1251</th>\n",
              "      <td>18.120001</td>\n",
              "      <td>16.930000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1252</th>\n",
              "      <td>16.520000</td>\n",
              "      <td>16.650000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1253</th>\n",
              "      <td>16.879999</td>\n",
              "      <td>17.900000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1254</th>\n",
              "      <td>17.430000</td>\n",
              "      <td>17.490000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1255</th>\n",
              "      <td>17.530001</td>\n",
              "      <td>17.820000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1256</th>\n",
              "      <td>18.150000</td>\n",
              "      <td>18.459999</td>\n",
              "    </tr>\n",
              "  </tbody>\n",
              "</table>\n",
              "<p>1257 rows × 2 columns</p>\n",
              "</div>"
            ],
            "text/plain": [
              "           Open      Close\n",
              "0      3.980000   4.000000\n",
              "1      4.010000   4.130000\n",
              "2      4.190000   4.180000\n",
              "3      4.230000   4.180000\n",
              "4      4.200000   4.090000\n",
              "5      4.090000   4.170000\n",
              "6      4.190000   4.130000\n",
              "7      4.140000   4.300000\n",
              "8      4.340000   4.470000\n",
              "9      4.500000   4.380000\n",
              "10     4.150000   4.180000\n",
              "11     4.310000   4.170000\n",
              "12     3.790000   3.670000\n",
              "13     3.670000   3.620000\n",
              "14     3.600000   3.470000\n",
              "15     3.480000   3.410000\n",
              "16     3.430000   3.540000\n",
              "17     3.520000   3.480000\n",
              "18     3.510000   3.480000\n",
              "19     3.450000   3.430000\n",
              "20     3.430000   3.330000\n",
              "21     3.350000   3.370000\n",
              "22     3.360000   3.310000\n",
              "23     3.320000   3.410000\n",
              "24     3.460000   3.470000\n",
              "25     3.500000   3.630000\n",
              "26     3.660000   3.700000\n",
              "27     3.710000   3.690000\n",
              "28     3.640000   3.700000\n",
              "29     3.700000   3.690000\n",
              "...         ...        ...\n",
              "1227  20.719999  21.490000\n",
              "1228  19.870001  20.660000\n",
              "1229  20.400000  19.110001\n",
              "1230  17.400000  19.209999\n",
              "1231  20.049999  18.730000\n",
              "1232  18.610001  19.379999\n",
              "1233  19.959999  20.080000\n",
              "1234  19.770000  21.049999\n",
              "1235  21.820000  21.340000\n",
              "1236  21.190001  21.430000\n",
              "1237  21.299999  21.299999\n",
              "1238  22.480000  23.709999\n",
              "1239  23.350000  21.120001\n",
              "1240  20.219999  21.299999\n",
              "1241  21.299999  19.459999\n",
              "1242  19.350000  19.990000\n",
              "1243  20.709999  19.980000\n",
              "1244  20.320000  20.480000\n",
              "1245  20.629999  19.860001\n",
              "1246  19.580000  19.900000\n",
              "1247  20.010000  18.830000\n",
              "1248  19.150000  19.500000\n",
              "1249  19.440001  18.160000\n",
              "1250  18.110001  17.940001\n",
              "1251  18.120001  16.930000\n",
              "1252  16.520000  16.650000\n",
              "1253  16.879999  17.900000\n",
              "1254  17.430000  17.490000\n",
              "1255  17.530001  17.820000\n",
              "1256  18.150000  18.459999\n",
              "\n[1257 rows x 2 columns]"
            ]
          },
          "metadata": {}
        }
      ],
      "execution_count": 45,
      "metadata": {
        "collapsed": false,
        "outputHidden": false,
        "inputHidden": false
      }
    },
    {
      "cell_type": "code",
      "source": [
        "df[0:2]"
      ],
      "outputs": [
        {
          "output_type": "execute_result",
          "execution_count": 46,
          "data": {
            "text/html": [
              "<div>\n",
              "<style scoped>\n",
              "    .dataframe tbody tr th:only-of-type {\n",
              "        vertical-align: middle;\n",
              "    }\n",
              "\n",
              "    .dataframe tbody tr th {\n",
              "        vertical-align: top;\n",
              "    }\n",
              "\n",
              "    .dataframe thead th {\n",
              "        text-align: right;\n",
              "    }\n",
              "</style>\n",
              "<table border=\"1\" class=\"dataframe\">\n",
              "  <thead>\n",
              "    <tr style=\"text-align: right;\">\n",
              "      <th></th>\n",
              "      <th>Date</th>\n",
              "      <th>Open</th>\n",
              "      <th>High</th>\n",
              "      <th>Low</th>\n",
              "      <th>Close</th>\n",
              "      <th>Adj Close</th>\n",
              "      <th>Volume</th>\n",
              "      <th>Open_Close</th>\n",
              "      <th>High_Low</th>\n",
              "      <th>Increase_Decrease</th>\n",
              "      <th>Buy_Sell_on_Open</th>\n",
              "      <th>Buy_Sell</th>\n",
              "      <th>Returns</th>\n",
              "    </tr>\n",
              "  </thead>\n",
              "  <tbody>\n",
              "    <tr>\n",
              "      <th>0</th>\n",
              "      <td>2014-01-03</td>\n",
              "      <td>3.98</td>\n",
              "      <td>4.00</td>\n",
              "      <td>3.88</td>\n",
              "      <td>4.00</td>\n",
              "      <td>4.00</td>\n",
              "      <td>22887200</td>\n",
              "      <td>-0.005025</td>\n",
              "      <td>0.030928</td>\n",
              "      <td>1</td>\n",
              "      <td>1</td>\n",
              "      <td>1</td>\n",
              "      <td>0.012658</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1</th>\n",
              "      <td>2014-01-06</td>\n",
              "      <td>4.01</td>\n",
              "      <td>4.18</td>\n",
              "      <td>3.99</td>\n",
              "      <td>4.13</td>\n",
              "      <td>4.13</td>\n",
              "      <td>42398300</td>\n",
              "      <td>-0.029925</td>\n",
              "      <td>0.047619</td>\n",
              "      <td>1</td>\n",
              "      <td>1</td>\n",
              "      <td>1</td>\n",
              "      <td>0.032500</td>\n",
              "    </tr>\n",
              "  </tbody>\n",
              "</table>\n",
              "</div>"
            ],
            "text/plain": [
              "        Date  Open  High   Low  Close  Adj Close    Volume  Open_Close  \\\n",
              "0 2014-01-03  3.98  4.00  3.88   4.00       4.00  22887200   -0.005025   \n",
              "1 2014-01-06  4.01  4.18  3.99   4.13       4.13  42398300   -0.029925   \n",
              "\n",
              "   High_Low  Increase_Decrease  Buy_Sell_on_Open  Buy_Sell   Returns  \n",
              "0  0.030928                  1                 1         1  0.012658  \n",
              "1  0.047619                  1                 1         1  0.032500  "
            ]
          },
          "metadata": {}
        }
      ],
      "execution_count": 46,
      "metadata": {
        "collapsed": false,
        "outputHidden": false,
        "inputHidden": false
      }
    },
    {
      "cell_type": "code",
      "source": [
        "# use iloc!\n",
        "df.iloc[0:2, :]"
      ],
      "outputs": [
        {
          "output_type": "execute_result",
          "execution_count": 47,
          "data": {
            "text/html": [
              "<div>\n",
              "<style scoped>\n",
              "    .dataframe tbody tr th:only-of-type {\n",
              "        vertical-align: middle;\n",
              "    }\n",
              "\n",
              "    .dataframe tbody tr th {\n",
              "        vertical-align: top;\n",
              "    }\n",
              "\n",
              "    .dataframe thead th {\n",
              "        text-align: right;\n",
              "    }\n",
              "</style>\n",
              "<table border=\"1\" class=\"dataframe\">\n",
              "  <thead>\n",
              "    <tr style=\"text-align: right;\">\n",
              "      <th></th>\n",
              "      <th>Date</th>\n",
              "      <th>Open</th>\n",
              "      <th>High</th>\n",
              "      <th>Low</th>\n",
              "      <th>Close</th>\n",
              "      <th>Adj Close</th>\n",
              "      <th>Volume</th>\n",
              "      <th>Open_Close</th>\n",
              "      <th>High_Low</th>\n",
              "      <th>Increase_Decrease</th>\n",
              "      <th>Buy_Sell_on_Open</th>\n",
              "      <th>Buy_Sell</th>\n",
              "      <th>Returns</th>\n",
              "    </tr>\n",
              "  </thead>\n",
              "  <tbody>\n",
              "    <tr>\n",
              "      <th>0</th>\n",
              "      <td>2014-01-03</td>\n",
              "      <td>3.98</td>\n",
              "      <td>4.00</td>\n",
              "      <td>3.88</td>\n",
              "      <td>4.00</td>\n",
              "      <td>4.00</td>\n",
              "      <td>22887200</td>\n",
              "      <td>-0.005025</td>\n",
              "      <td>0.030928</td>\n",
              "      <td>1</td>\n",
              "      <td>1</td>\n",
              "      <td>1</td>\n",
              "      <td>0.012658</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1</th>\n",
              "      <td>2014-01-06</td>\n",
              "      <td>4.01</td>\n",
              "      <td>4.18</td>\n",
              "      <td>3.99</td>\n",
              "      <td>4.13</td>\n",
              "      <td>4.13</td>\n",
              "      <td>42398300</td>\n",
              "      <td>-0.029925</td>\n",
              "      <td>0.047619</td>\n",
              "      <td>1</td>\n",
              "      <td>1</td>\n",
              "      <td>1</td>\n",
              "      <td>0.032500</td>\n",
              "    </tr>\n",
              "  </tbody>\n",
              "</table>\n",
              "</div>"
            ],
            "text/plain": [
              "        Date  Open  High   Low  Close  Adj Close    Volume  Open_Close  \\\n",
              "0 2014-01-03  3.98  4.00  3.88   4.00       4.00  22887200   -0.005025   \n",
              "1 2014-01-06  4.01  4.18  3.99   4.13       4.13  42398300   -0.029925   \n",
              "\n",
              "   High_Low  Increase_Decrease  Buy_Sell_on_Open  Buy_Sell   Returns  \n",
              "0  0.030928                  1                 1         1  0.012658  \n",
              "1  0.047619                  1                 1         1  0.032500  "
            ]
          },
          "metadata": {}
        }
      ],
      "execution_count": 47,
      "metadata": {
        "collapsed": false,
        "outputHidden": false,
        "inputHidden": false
      }
    },
    {
      "cell_type": "code",
      "source": [
        "df.ix[0]"
      ],
      "outputs": [
        {
          "output_type": "execute_result",
          "execution_count": 50,
          "data": {
            "text/plain": [
              "Date                 2014-01-03 00:00:00\n",
              "Open                                3.98\n",
              "High                                   4\n",
              "Low                                 3.88\n",
              "Close                                  4\n",
              "Adj Close                              4\n",
              "Volume                          22887200\n",
              "Open_Close                   -0.00502513\n",
              "High_Low                       0.0309278\n",
              "Increase_Decrease                      1\n",
              "Buy_Sell_on_Open                       1\n",
              "Buy_Sell                               1\n",
              "Returns                        0.0126582\n",
              "Name: 0, dtype: object"
            ]
          },
          "metadata": {}
        }
      ],
      "execution_count": 50,
      "metadata": {
        "collapsed": false,
        "outputHidden": false,
        "inputHidden": false
      }
    },
    {
      "cell_type": "code",
      "source": [
        "df.ix[0, 1] # 0 row, 1 column"
      ],
      "outputs": [
        {
          "output_type": "execute_result",
          "execution_count": 54,
          "data": {
            "text/plain": [
              "3.98"
            ]
          },
          "metadata": {}
        }
      ],
      "execution_count": 54,
      "metadata": {
        "collapsed": false,
        "outputHidden": false,
        "inputHidden": false
      }
    },
    {
      "cell_type": "code",
      "source": [
        "df.ix[1, 'Volume']"
      ],
      "outputs": [
        {
          "output_type": "execute_result",
          "execution_count": 55,
          "data": {
            "text/plain": [
              "42398300"
            ]
          },
          "metadata": {}
        }
      ],
      "execution_count": 55,
      "metadata": {
        "collapsed": false,
        "outputHidden": false,
        "inputHidden": false
      }
    },
    {
      "cell_type": "code",
      "source": [
        "df.ix[0:2, 0:2]"
      ],
      "outputs": [
        {
          "output_type": "execute_result",
          "execution_count": 59,
          "data": {
            "text/html": [
              "<div>\n",
              "<style scoped>\n",
              "    .dataframe tbody tr th:only-of-type {\n",
              "        vertical-align: middle;\n",
              "    }\n",
              "\n",
              "    .dataframe tbody tr th {\n",
              "        vertical-align: top;\n",
              "    }\n",
              "\n",
              "    .dataframe thead th {\n",
              "        text-align: right;\n",
              "    }\n",
              "</style>\n",
              "<table border=\"1\" class=\"dataframe\">\n",
              "  <thead>\n",
              "    <tr style=\"text-align: right;\">\n",
              "      <th></th>\n",
              "      <th>Date</th>\n",
              "      <th>Open</th>\n",
              "    </tr>\n",
              "  </thead>\n",
              "  <tbody>\n",
              "    <tr>\n",
              "      <th>0</th>\n",
              "      <td>2014-01-03</td>\n",
              "      <td>3.98</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1</th>\n",
              "      <td>2014-01-06</td>\n",
              "      <td>4.01</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>2</th>\n",
              "      <td>2014-01-07</td>\n",
              "      <td>4.19</td>\n",
              "    </tr>\n",
              "  </tbody>\n",
              "</table>\n",
              "</div>"
            ],
            "text/plain": [
              "        Date  Open\n",
              "0 2014-01-03  3.98\n",
              "1 2014-01-06  4.01\n",
              "2 2014-01-07  4.19"
            ]
          },
          "metadata": {}
        }
      ],
      "execution_count": 59,
      "metadata": {
        "collapsed": false,
        "outputHidden": false,
        "inputHidden": false
      }
    }
  ],
  "metadata": {
    "kernel_info": {
      "name": "python3"
    },
    "language_info": {
      "mimetype": "text/x-python",
      "pygments_lexer": "ipython3",
      "nbconvert_exporter": "python",
      "file_extension": ".py",
      "codemirror_mode": {
        "name": "ipython",
        "version": 3
      },
      "name": "python",
      "version": "3.5.5"
    },
    "kernelspec": {
      "name": "python3",
      "language": "python",
      "display_name": "Python 3"
    },
    "nteract": {
      "version": "0.12.2"
    }
  },
  "nbformat": 4,
  "nbformat_minor": 4
}